User Tools

Site Tools


After Share Script


The “After share script” section allow you to specify a script that will run after the dynamic share has shared a record. This can be useful for when you run scripts in the Before share script section that you want to then cancel out after the dynamic share has run.

This section expect server side javascript. Within your script you have access to the following variables:

current This represents the record that is being shared out
dynamicshare_gr B Release An object corresponding to the dynamic share configuration itself (i.e. you can use dynamicshare_gr.table_name to access the “table” field of the dynamic share)

Specifying a foreign language in a dynamic share after share script

One example use case is to use the Before and After share script sections together to specify a language to share out records in. In the Before share script section you would have the following script so all records shared out will have English translated text (for fields that support translation as mentioned in the language link above):

var lang = gs.getSession().getLanguage(); 
var gc = (typeof GlideController != 'undefined') ? GlideController :;
gc.putGlobal('user_lang', lang);

And then in the After share script section, you would cancel this change so it doesn't affect users who are using the system and want to see translations in their selected language:

var gc = (typeof GlideController != 'undefined') ? GlideController :;
var userlang = gc.getGlobal('user_lang');
snc_dynamic_after_share_script.txt · Last modified: 2019/03/03 17:23 by timothy.pike