Save event arguments

In the save event of the Entity, we can pass the execution context as a parameter.

It has getEventArgs method to retrieve an object that contains methods you can use to manage the save events.

It returns an integer value

 
Returns a value indicating how the save event was initiated by the user.
executionObj.getEventArgs().getSaveMode()


It returns an integer value

Entity
Mode Value
All Save 1
All Save and Close 2
All Save and New 59
All AutoSave 70
Activities Save as Completed 58
All Deactivate 5
All Reactivate 6
User or Team owned entities Assign 47
Email (E-mail) Send 7
Lead Qualify 16
Lead Disqualify 15

 

preventDefault

Cancels the save operation, but all remaining handlers for the event will still be executed.
executionObj.getEventArgs().preventDefault()
 

isDefaultPrevented
          Returns a value indicating whether the save event has been canceled because the preventDefault method was used in this event hander or a previous event handler.
     executionObj.getEventArgs().isDefaultPrevented()

Hope this helps.


Happy CRM’img
Gopinath.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s