Customization, Development, Dynamics CRM

Reactivate of records calls onSave function

Today I tried to reactivate a lead in our crm system, but that failed with an error based on the checks in my onSave() function in my custom javascript. Therefore I was digging around and found out, that reactivating calls the onSave-function with additional information.

In my case, the most important property is the saveMode with its value. This property can be retrieved from the parameter, offered by the onSave method.

The syntax looks like executionContext.getEventArgs().getSaveMode()

The following code snippet demonstrates this function:

You can find the different values of saveMode on the Microsoft-Docs.