Skip to navigation

Examples of conditions for common use cases

View as Markdown

Provides examples and explanations of conditions for common use cases.

Conditions with the AND operator

example - AND operator

The conditions defined in the figure are equal to the following JEXL expression:

changeType == 'UPDATE' && Invoice.Status == 'Posted' && Invoice.Status_old != 'Posted' && Invoice.Amount > 1000.0

It is triggered when an invoice is posted with an amount greater than 1000.

Conditions for multiple change types

example - multiple change types

The conditions defined in the figure are equal to the following JEXL expression:

changeType == 'INSERT' || changeType == 'UPDATE'

It is triggered when a record of the base object is created or updated.

Conditions for custom objects

example - custom object

The conditions defined in the figure are equal to the following JEXL expression:

changeType == 'UPDATE' && default__entitlement.Usage__c >= default__entitlement.Entitled__c && default__entitlement.Status != 'Trial'

It is triggered when an entitlement record is updated if the usage equals to or greater than the entitlement and the entitlement status is not trial.

Conditions and groups

example - groups

The conditions defined in the figure are equal to the following JEXL expression:

changeType == 'UPDATE' && (Invoice.Status == 'Draft' || Invoice.Status == 'Posted') && (Invoice.Amount < 20.0 || Invoice.Amount > 1000.0)

It is triggered when an invoice of Draft or Posted status is updated with an amount less than 20 or greater than 1000.

Groups and sub-groups

example - subgroup

The conditions defined in the figure are equal to the following JEXL expression:

changeType == 'UPDATE' && (default__entitlements.Status__c == 'Trial' || (default__entitlements.Usage__c < default__entitlements.Entitled__c && default__entitlements.Usage__c > 10.0))

It is triggered when an entitlement record is updated and the entitlement status is trial, or the usage is less than the entitled value and greater than 10.