Sample code for custom events
Provides sample code for frequently used custom events.
You can use these code samples to create custom events through the Create an event trigger API operation.
Bill Run Posted
You can use the following request sample to create a custom event of BillRunPosted if you do not use the auto-post on Bill Runs.
Payment Term Updated
You can use the following request sample to create a custom event of AccountPaymentTermUpdate.
Custom object record created
You can use the following request sample to create a custom event that will be triggered when certain custom object records are created for the Vehicle custom object.
Custom object record updated
You can use the following request sample to create a custom event that will be triggered when certain custom object records are updated for the Entitlement custom object.
Order Action for subscription cancellation created
You can use the following request sample to create a custom event that is triggered when a subscription cancellation order action is created and its cancellation effective date matches the order action creation date.
Because OrderAction.CreatedDate is a timestamp field and OrderAction.CancellationEffectiveDate is a date field, they cannot be compared directly, so the sample uses the built-in toLocalDate() function to convert the timestamp to a date before performing the comparison.