After subscribe scripts (server-side JavaScript) will run after an inbound (subscribed) record from a sharing instance is synced on the subscribing instance. Within your after subscribe script, you have access to the following variables:
Variable | Description |
---|---|
current | Record that was inserted, updated or deleted, the destination record |
qcurrent | Record within the psp_in_message table (pulled from the Perspectium Mesh). Use the message's key value to determine its source. |
qcurrentxml | Holds the xml object of the inbound record |
xml_util | Holds an xml utility for working with qcurrentxml |
subscribe_gr | Holds the GlideRecord object corresponding to the subscribe record configuration itself (You can use subscribe_gr.getTableName() to access the name of the table you're trying to insert) |
First, you will need to follow the steps to get started with Replicator.
To create an after subscribe script, follow these steps:
|