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:
1 2 3 4 5 |
onFormSave: function (executionObj) { if (executionObj.getEventArgs().getSaveMode() != 6) { // only if not reactivation } } |
You can find the different values of saveMode on the Microsoft-Docs.