<style> .release-box { height: 30px; width: 100px; padding-top: 8px; text-align: center; border-radius: 5px; font-weight: bold; background-color: #0ACA8B; border-color: #FCE28A; } .release-box:hover { cursor: hand; cursor: pointer; opacity: .9; } </style> <meta name="robots" content="noindex"> <div class="release-box"> <a href="https://docs.perspectium.com/display/fluorineplus" style="text-decoration: none; color: #FFFFFF; display: block;"> Fluorine+ </a> </div> |
Before subscribe scripts are created with server-side JavaScript and will execute right before an insert or update allowing a chance to modify the record before persisting. Within your before subscribe script, you have access to the following variables:
Variable | Description |
---|---|
current | Record that is being inserted or updated |
repl_gr | Temporary inbound record. Will be mapped to repl_gr by default. |
gr_before | Record before any update is made to it. If the record doesn't exist (i.e., for an insert), then this variable will be assigned to current. |
qcurrent | Record within the psp_in_message table (pulled from the Perspectium Mesh). Use the message's key value to determine its source. |
ignore | Can assign a value of true in order to stop the execution of the subscribe |
qcurrentxml | Holds the xml object of the inbound record |
xml_util | Holds an xml utility for working with qcurrentxml |
After subscribe scripts
After subscribe scripts are also created with server-side JavaScript and 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 configure a ServiceNow instance as a subscriber.
To create a before/after subscribe script, follow these steps:
|