Friday, November 3, 2017

Dynamics CRM Javascript Code Snippets

In this post, I'm going to post some JavaScript code snippets, this might be helpful while customize the CRM. Should work for all versions!

---------------------------------------------------------------------------------
Get the GUID of the lookup field:
var obj1 = Xrm.Page.getAttribute("schemanameoflookupfield");
alert("" +obj1.getValue()[0].id);
---------------------------------------------------------------------------------



Get the value of the picklist:
var obj = Xrm.Page.getAttribute("schemanameofpicklistfield");
alert("" + obj.getValue());
---------------------------------------------------------------------------------

Questions/comments/suggestions? please put it in comments below post for further discussion!!!

Follow By Email for more updates directly into your inbox...

No comments:

Post a Comment