Posts

Showing posts from May, 2014
Useful Javascript which is used Frequently in MS CRM. 1.  Get the GUID value of a lookup field: Note: this example reads and pops the GUID of the primary contact on the Account form function AlertGUID() {     var primaryContactGUID = Xrm.Page.data.entity.attributes.get("primarycontactid").getValue()[0].id;     alert(primaryContactGUID); } 2. Get the Text value of a lookup field: Note: this example reads and pops the name of the primary contact on the Account form function AlertText() {     var primaryContactName = Xrm.Page.data.entity.attributes.get("primarycontactid").getValue()[0].name;     alert(primaryContactName); } 3.  Get the value of a text field: Note: this example reads and pops the value of the Main Phone (telephone1) field on the Account form function AlertTextField() {     var MainPhone = Xrm.Page.data.entity.attributes.get("telephone1").getValue();     alert(MainPhone); } 4.  Get the database v