Wednesday, June 12, 2013

CRM 2011 - Saving a record using javascript

Using JavaScript we can initiate the save operation in CRM 2011.
 
The Xrm.Page.data.entity attribute collection has inbuilt method Save() to achieve this particular action. With respect to the parameter passed via this method we can achieve save the form action, save and close the form, save and open a new form actions easily.
 
Below are the examples to achieve this,
 
function Save()

{
// Saves the record.
Xrm.Page.data.entity.save();
}
function SaveAndClose()

{
// Saves the record and closed the window.
Xrm.Page.data.entity.save("saveandclose");
 
 
}
function SaveAndNew()
 
{
// Saves the record and open a new window.
Xrm.Page.data.entity.save("saveandnew");
 
 
}

No comments:

Configuration for CRM Plugins

CRM plugins are always great feature where we can automate many functionality which we cannot automate from user interface. But almost eve...