The CommsService.TriggerEvent() function has six required arguments which are outlined in the table below:
Argument | Type/Return Type | Description/Typical Value |
---|---|---|
To trigger the Communication Service, follow these steps:
Open your project and navigate to Data.
Select Diagram or List to view your Data Model.
Locate and select the entity for which you want to configure communications. In a Diagram view, click on the entity's header section with a grey background colour. An active entity is identified by a blue border, and none of its entity fields are active (active entity fields have a blue background colour).
This action will open a properties dialog that displays the entity's global properties.
Within the properties dialog, locate Custom Code you can expand the text editor by clicking on the icon.
Now, you need to identify and select a change interceptor to initiate the ComsService.Trigger()
function. If the custom code has already been auto-generated, you can proceed with selecting an appropriate change interceptor. However, if the custom code hasn't been auto-generated, you have the option to define your own partial class. Within this class, you can invoke the ComsService.Trigger()
function using the interceptor of your choice as shown(check line 66 in the code block below):
After triggering the Communication Service by adding the code to invoke the ComsService.Trigger()
function, the next step is to configure the event action and templates.
appName
String
Config.AppName()
eventName
String
A unique name of your event defined under Configuration -> Communication Services
payload
JSON
Use the ComsServices.JsonSerialize()
function to serialise the current instance of your class into JSON
url
String
Config.ComsService()
userName
String
Config.UserName()
password
String
Config.Password()