How to avoid use of sys_id in Client script

pradeepgupta
Giga Expert

Hi,

What is the best practice to avoid use of sys_id in client script.

E.g. onChange of category wanted to set assignment group to ABC.

if(category=='Test')

{

g_form.setValue('assignment_group', '196589360f6471008fdcfa6ce1050e3a(sys_id of ABC)', 'ABC');

}

How to avoid use of sys_id here, as we can not use gs.getProperty in client script? Any idea ?

12 REPLIES 12

Anurag Tripathi
Mega Patron
Mega Patron

use display business rule and set the sys_id on a scratchpad variable....access the scratchpad in client script.



BTW, why cant you use property?


-Anurag

Harish Murikina
Tera Guru

gs is server side object we cant use in client side. The only way is use sys_id.


Kalaiarasan Pus
Giga Sage

Yes you can use gs.getProperty Not kidding but just make use of a ajax call and have it in a script include .... If you want to save the server round trip, make use of display business rule + scratchpad..


Thanks everyone for the reply.


Display business rule + scratchpad will be good solution.