Gives you access to contextual information in an event handler. For example, the name of a created company or the amount of a sale.
You can also check EventData properties after the event handler has run, to for example display a message or prevent an entity from being saved.
Constructors
EventData()
Initializes a new instance of the EventData class.
Methods
getBlockExecution()
Checks whether the current event action has been blocked.
Returns: CRMScript.Global.Bool
Returns the value of a specified input field (for example “ContactEntity.Department”).
Returns: CRMScript.Global.String - The value of the field.
Use Trace to discover the name of the input value you want to fetch.
Example:
Returns a Map containing all input values of the EventData object.
Returns: CRMScript.Native.Map - All input values of the object.
Example:
getMessage()
Returns the message set in an EventData object.
Returns: CRMScript.Global.String - The message set in the object.
Example:
getNavigateTo()
Returns the section EventData has navigated to.
Returns: CRMScript.Global.String
getStateValue(String)
Returns the value of a specified state field (custom field).
Returns: CRMScript.Global.String
getStateValues()
Returns a Map containing all state values of the EventData object (custom values).
Returns: CRMScript.Native.Map
getType()
Returns the integer representing the event type.
Returns: CRMScript.Global.Integer
Example:
setBlockExecution(Bool)
Prevent the current event action from being executed.
Returns: CRMScript.Global.Void
setMessage(String)
Displays a dialog box containing the specified message.
Returns: CRMScript.Global.Void
Example:
setNavigateTo(String)
Sets which page to load next. For example, “sale.main”.
Returns: CRMScript.Global.Void
Example:
setOutputValue(String,String)
Sets the value of a specified output field (for example “ContactEntity.Department”).
Returns: CRMScript.Global.Void
Example:
setStateValue(String,String)
Sets a state value that can be accessed later, also by other EventData objects in the same script (custom value).
Returns: CRMScript.Global.Void
setValidationMessage(String)
A shorthand for calling setBlockExecution(true) and setMessage(message).
It allows you to block a save and set a response message in a single function call.
Returns: CRMScript.Global.Void
Example:
showDialog(EventDataDialogDefinition)
Triggers a dialog to handle user input.
Returns: CRMScript.Global.Void