Tuesday 12 May 2015

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
ModeValue
AllSave1
AllSave and Close2
AllSave and New59
AllAutoSave70
ActivitiesSave as Completed58
AllDeactivate5
AllReactivate6
User or Team owned entitiesAssign47
Email (E-mail)Send7
LeadQualify16
LeadDisqualify15
 
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.

No comments:

Post a Comment