Using JavaScript we can identify each of the save event mode from CRM 2011 application using the below method.
executionobj.getEventArgs().getSaveMode();
This method returns a number from which the save initiated entity and the save mode can be identified.
Below are the supported return values for CRM 2011.
- Applicable to all the entities
- 1 - Save
- 2 - Save and Close
- 59 - Save and new
- 5 - Deactivate
- 6 - Reactivate
- Activities entity
- 58 - Save as completed
- User or Teams owned entities
- 47 - Assign
- 7 - Send
- Lead
- 16 - Qualify
- 15 - Disqualify
When this method is added to the form make sure to enable the check box "Pass execution context as first parameter". This will get us the executionobj mentioned above. Below is an example of the sample method.
function getSaveMode(executionobj)
{
return executionobj.getEventArgs().getSaveMode();
}
No comments:
Post a Comment