How to: Which action raised OnSave event

A while ago, I wrote a post about the way to know which action raised the onSave event in Microsoft Dynamics CRM 4.0, here.

Here is the same code for Microsoft Dynamics CRM 2011:

// The execution context must be passed as the first parameter
// This can be done by ticking the checkbox in the function call
// window in the onSave event
function CheckSaveEvent(executionObj)
{
// If action is Save as closed (=58)
if(executionObj.getEventArgs().getSaveMode() == 58)
{
// Do some code logic
}
}




The check that must be ticked is the one in the below screenshot (This is the window that is displayed when adding script on the onSave event).


CRM 2011 RC1 [En fonction] - Oracle VM VirtualBox_2011-04-29_15-56-30

Comments

Sunil R said…
Thanks. It was a great help!!

Popular posts from this blog

Use feature flags in your plugins

New XrmToolBox plugin : Import/Export NN relationships

Searchable Propery Attribute Updater