This is an old revision of the document!
A before share script allows the current record that is being shared to be processed after it is loaded into a GlideRecord, but before it is encrypted and queued up to the Perspectium Cloud Server. This feature is available for both Dynamic Share and Bulk Share.
For example, to ensure that the short_description field value of a record to always be greater than 0 and less than 1000 characters, you may use the following script:
var s = current.short_description.toString(); current.short_description = s.substring(0, 1000);
Because this script is executed every time a record is shared, be aware of the processing delays introduced that will be multiplied when sharing multiple records at the same time.