jump to navigation

Microsoft CRM 2011 Disable Fields From Picklist May 24, 2011

Posted by jarrettexpertcrm in Uncategorized.
Tags: , , , , , , , ,
3 comments


In some cases you need to disable fields based of the value of a picklist. Below is the code to achieve this.

function disableToggle()
{

var value = Xrm.Page.getAttribute(“PICKLISTFIELD”).getValue()
// First Picklist value
if (value == “100000000”)
{
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(false);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(false);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);

}
// Second picklist value
else if (value == “100000001”)
{
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(false);

}
// Third picklist value
else if (value == “100000002”)
{
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(false);

}
// Fourth picklist value
else if (value == “100000003”)
{
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(true);
Xrm.Page.ui.controls.get(“FIELD”).setDisabled(false);

}
}

Enjoy!!

– JC

For more information about Dynamics Four you can contact us at http://www.dynamics4.com

Advertisements

Microsoft Dynamics CRM 4.0 / 2011 Tech Tuesdays and Webinars January 11, 2011

Posted by jarrettexpertcrm in Microsoft CRM General, Uncategorized.
Tags: , , , , , , , , , , , ,
1 comment so far

CRM 2011 Preview – the Power of Productivity.
Join this free webinar to learn more about the newest release of Microsoft Dynamics CRM.
Sessions are held on the 2nd Thursday of each month.

Tech Tuesdays – Get practical answers and proven solutions from the CRM experts. Dynamics Four offers a free one session designed to explore new concepts, capabilities, and general discussion covering the sales, marketing, and service modules within Dynamics CRM. Sessions are held on the 2nd Tuesday of each month.

http://www.clicktoattend.com/?id=153046 This is link to sign up for Tech Tuesday

http://www.clicktoattend.com/?id=153074 – Link to sign up for CRM2011 preview

Enjoy!

-JC

For more information about Dynamics Four or to contact us please visit http://www.dynamics4.com