Friday 18 May 2012

To Retrieve Option Set Selected Text Value in CRM 2011


To get the Pick list value ........

Xrm.Page.getAttribute("wi_opportunityprobability").getValue();

To retrieve the Option Set selected text .......

Xrm.Page.getAttribute("wi_opportunityprobability").getText();



Tuesday 8 May 2012

Working With CRM 2011 Fields

To Disable the Lookup fields......

          Xrm.Page.ui.controls.get("fieldnameid").setDisabled(true);

To Retrieve Value from CRM2011 Field........

          Xrm.Page.getAttribute("fieldnameid").getValue();

To make the field mandatory............
 
           Xrm.Page.getAttribute("fieldname").setRequiredLevel("required");

To make non-mandatory........

           Xrm.Page.getAttribute("fieldname").setRequiredLevel("none");

Assign Value to the Picklist........

          Xrm.Page.getAttribute("fieldname").setValue(1);

To Make the Field Empty(null).......

           Xrm.Page.getAttribute("fieldname").setValue(null); 


Happy CRMing................


CRM 2011 ViewPicker off through JavaScript

Hi friends.......

CRM 2011 having the feature of selecting the view in the lookup field.But Some time our need is to write the custom code and to disable the 'View Selector'. But for custom lookups you can't disable the view selector initially through out of box.. If you try to do the view selector 'Off' in the form, then your custom code will not work.So only way is, to add some javascript in the custom code. Ofcourse, this is unsupported,MS should come back with answer. Meanwhile we can use this line to achieve.

document.getElementById("fieldnameid").disableViewPicker = 1;

Thanks

Happy CRMing.......