This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
before_share_script [2018/03/29 14:24] robyn.lin |
before_share_script [2018/05/15 00:13] (current) paul [psp_key] |
||
---|---|---|---|
Line 33: | Line 33: | ||
===== share_gr ===== | ===== share_gr ===== | ||
+ | <wrap info>v3.31.0</wrap>\\ | ||
To access the Bulk and Dynamic Share records themselves from the Before Share Script, use the global variable //share_gr//. | To access the Bulk and Dynamic Share records themselves from the Before Share Script, use the global variable //share_gr//. | ||
Line 42: | Line 43: | ||
===== previous ===== | ===== previous ===== | ||
- | To access the previous record in a Dynamic Share (ie, a record before it has been modified), use the global variable “previous” in the Before Share script. For example, the following script will log the value of the previous record’s short description: | + | <wrap info>v3.31.0</wrap>\\ |
+ | To access the previous record in a Dynamic Share (ie, a record before it has been modified), use the global variable //previous// in the Before Share script. For example, the following script will log the value of the previous record’s short description: | ||
<code javascript> | <code javascript> | ||
Line 54: | Line 56: | ||
//do something here | //do something here | ||
} | } | ||
+ | </code> | ||
+ | |||
+ | <WRAP round important> | ||
+ | *Note: you can only access the //previous// variable when the “Business Rule When” is set to “before” or “after” under Trigger Conditions of the Dynamic Share (it will not work with “async”). | ||
+ | |||
+ | In addition, the information above only applies to Dynamic Shares; the data shared in a Bulk Share is historical and will not have been modified. | ||
+ | </WRAP> | ||
+ | ===== psp_key ===== | ||
+ | <wrap info>[[carbon_release|Carbon]]</wrap>\\ | ||
+ | To access the key value of the outbound message, you can change the psp_key global dynamically. | ||
+ | |||
+ | To enabled this functionality, turn off com.perspectium.validate_mismatch_key in your Perspectium properties. | ||
+ | |||
+ | <code javascript> | ||
+ | // run on before share | ||
+ | psp_key = "custom_client"; | ||
</code> | </code> |