EventData properties after the event handler has run, to for example display a message or prevent an entity from being saved.
Example
Check if a sale has a high enough value. Return a message and block the sale for values < 100. Set for the event “Before save sale”.Fetch variables used in the current context
EventData doesn’t work with manually run scripts!
Type
The types of events that can occur pertain to either [Service screen events][1] (beforeSetFromCgi, afterSetFromCgi, beforePrint) or triggers.
- Integer
getType()
Input values
Input values are for getting available data - a read operation. You can either fetch a specific value or a Map with all values.- String getInputValue(String inputValue)
- Map getInputValues()
Output values
Output values are for setting (or changing) data - a write operation. They are frequently set on a before save trigger to get better data quality.Custom values
In addition to the built-in input and output values, you can also set and get custom values. These are also called state values and work just like setting and getting the standard values. The only difference is that naming the custom variables is up to you.
After you set a custom value, it can be accessed - also by other
EventData objects in the same script.
From version 10.5.2, we support listening for a command in StateValue to close Ticket tabs from CRMScript triggers in the Sales client.
Open dialog to handle user interaction
From version 10.1.9 we support generating a dialog from CRMScript triggers in Sales client.
Messages
- String getMessage()
- Void setMessage(String message)
Validation and blocking actions
- Bool getBlockExecution()
- Void setBlockExecution(Bool value)
- Void setValidationMessage(String message)
Setting criteria with a Map instead of multiple OR conditions in an if statement
Navigation
Navigation uses [SOProtocol][2] and [URL parameters][3].- String getNavigateTo()
- Void setNavigateTo(String url) [1]: ../../../ui/blogic/screen-events [2]: ../../../customization/soprotocol/index [3]: ../../../ui/blogic/url-parameters