Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One exception to this format is the OnCreate setting, which can have one of the following formats. See OnCreate Trigger section below for more information.


OnCreate Triggers

The OnCreate trigger executes whenever the related list plus button is tapped which is before other save triggers have a chance to run. When this setting is specified, the standard behavior to show the object in create mode is overridden with custom PSL code. This means that the PSL must ultimately handle how to respond to the plus button tap. For example, if the standard behavior is needed, the 'CreateAndMapFields' PSL action should be called as the last action in the custom PSL. 

There are two variants of OnCreate that can be used (Standard and PreInit), but only one should be specified per Parent/Child object association. If both happen to be specified, the PreInit variant will be executed and the Standard variant will be ignored. The difference between them is the context available to your PSL code. With the Standard variant, the context is the newly initialized object itself (in memory only). With the PreInit variant, the context is the parent of the object to create. You might decide to use PreInit if there are some actions or checks that must occur before the new child object can be initialized, perhaps to ensure certain values are passed to the create action.

Standard setting format:

Name:  Object Name – execution point
Key:     pulsar.onCreate.<Parent Object API Name>.<Child Object API Name>
Value:  Pulsar Settings Language

or

PreInit setting format:

Name:  Object Name – execution point

Key:     pulsar.onCreate.<Parent Object API Name>.<Child Object API Name>.PreInit
Value:  Pulsar Settings Language

The first version (without PreInit) runs immediately after the object is created, but before the object is committed to the database (before other save triggers have a chance to run). The second version (PreInit), runs before the object is created, in case there are trigger actions that must occur before the new child object can be created, perhaps to ensure certain values are passed to the create action.

Example Validation Rule

Name:   Order - Before Edit
Key:      pulsar.beforeEdit.Order__c
Value:   See the code below. This setting executes when the user tries to edit a record, and uses a query to determine if the user attempted to update a record that is already in status "Finalized" or "Cleared". If so, it alerts the user with the appropriate message.

...

Currently we only support the 'After Update' trigger type for reference fields only.  The trigger code can be any valid PSL and is executed only after a specified reference field has been updated.

...