Access Composite Controls in JavaScript CRM 2013/2015

Hi,
 
Today we got the requirement to disable Country/Region on the Address Composite Control. We never did this and don’t know how to do. Started searching here and there and at last found the solution for it.
 
Here is the JavaScript code for it.
 
Xrm.Page.getControl(“address1_composite_compositionLinkControl_address1_country”).setDisabled(true);

In the same way, we can use all the Xrm method like setValue, getValue, setVisible, getVisible, getDisabled etc…

In the below screen shot you will see Country/Region as not disabled.



Here is thee screen shot where Country/Region is disabled(locked).

 

Hope this helps.


Happy CRM’ing
Gopinath

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s