How to call business rule to client script?

ak4
Tera Contributor

How to call business rule to client script?

 

3 REPLIES 3

Nitin_NOW
Tera Guru

Hello 

You can write a display business rule and put the variable in g_scratchpad and get it in the client side using g_scratchpad.

Also you cannot directly call a BR into a Client script. Other way to handle this to create a Script Include and call it to Client script via GlideAjax. 

https://community.servicenow.com/community?id=community_question&sys_id=7416f0a3dbe6d340fff8a345ca96...

Please hit correct or helpful it this resolves your issue.

Thanks

Nitin

sriram35
Kilo Guru

Hi,

 

you have to use g_scratchpad.

Calling business rule from the client script is not possible but you can get only the scratchpad values from BR (display) into the client script. But the server-side script can be achievable from the Script Include using Glide Ajax.

 

 

Hope this helps!

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Sriram

 

 

snehalshelke
Tera Contributor

You cannot call business rule through client script. You can only get the scratchpad value through display business rule. If you want to call server side script through client side you need to write script include and then call it through GlideAjax.