Wednesday, 14 May 2014

Get all Atrributes in MS CRM2011

var attributes = Xrm.Page.data.entity.attributes.get();
 
for (var i in attributes) {
 
attributes[i].setSubmitMode("never");
 
}

Xrm.Page.ui.close();



Aim: To close the CRM form window using javascript when the user saves the form for a particular condition. 
Xrm.Page.ui.close();

This method closes the current form in which it is getting called. If any unsaved information is found, it prompts the user to save the changes prior to closing it.

If you don't want to show the prompt to the user you need to set submitMode to "never"
Below is the code snippet : 


No comments:

Post a Comment