Set a server side parameter

abhay10690951
Kilo Explorer

Hi ,

I just want to add a parameter server-side through business rule and i want to use getparameter to retrieve that value.

i can pass the value as an argument to the function of script include but i want to do this way without touching the pre defined servicenow script include.

script include has this.getParameter('abc');

i want to set this via 'abc' by business rule.

can i do that ?

2 REPLIES 2

Chuck Tomasi
Tera Patron

Hi Abhay,



If you are looking at a script include that references this.getParameter() it indicates it is client callable and (more than likely) intended to be used with a Client Script in a GlideAjax operation. I don't believe you can call the login in that script include from a business rule. What's more, passing the parameters isn't part of how they work.



I recommend you use the logic you need from the script include in your own script include and call that from your business rule.



Reference:


Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki


Script Includes - ServiceNow Wiki    


randrews
Tera Guru

you really don't need to do that.. just use a view BR to set a scratchpad variable..



g_scratchpad.variable_name = value;



then in client scripts you can reference g_scratchpad.variable_name anytime you want..



only use these when needed as they do run every time a record on the table is viewed.