Important javascript Functions for CRM
Getting the value of optionset
Xrm.Page.getAttribute("field logical name").getValue();
Getting the Text of optionset
Xrm.Page.getAttribute("fieldlogical name").getText();
Getting the GUID of Lookup
Xrm.Page.getAttribute("fieldlogical name").getValue()[0].id;
Getting the Text of Lookup
Xrm.Page.getAttribute("fieldlogical name ").getValue()[0].name;
Getting the value of single line text
Xrm.Page.getAttribute("fieldlogical name").getValue();
Setting value to the field
Xrm.Page.getAttribute("fieldlogicalname").setValue("Value we want to set");
Getting Entity Name
Xrm.Page.data.entity.getEntityName();
For refresh the Form
Location.Reload();
Save the page
Xrm.Page.data.entity.save();
This is really help full and also please give more information on plugins
ReplyDelete