Cannot use getReference method on client script , Glide ajax is the other way

Rahul84
Tera Contributor

Hi @Ankur Bawiskar /Team,

Facing one challenge to use getReference method on client script. I know the other way is to use Glide ajax call.

But I have a display business rule and have a g_scratchpad variable. 

I am having reference field "abc" on a table on which my onLoad client script is written and this "abc" field refers to other field that is having a manager field. I want the value of this manager field and needs to compare this with my g_scratchpad variable.

Pls let me know how can I use this on my client script instead of getRefernce. If Glide ajax is the way so pls provide me the logic and script for reference , how can I call my display BR on client script.

Thanks

21 REPLIES 21

Ankur Bawiskar
Tera Patron
Tera Patron

Then use display BR and store the manager in scratchpad and use it in onLoad client script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes Ankur , I have created the display BR and stored the manager value in the scratchpad 

but how can I use this on the onload client script . I cannot use the getRefernce method on client script because the tool doesn't allow. Any other way can you suggest.

pls let me know the logic

Hi,

you can use g_scratchpad variable value in client script and check that

can you share your both the scripts? BR and client script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Attaching both the screenshots (BR and client script).

Pls let me know the convenient way to do this. Cannot use the getReference method on client script becoz of the best practice..

Hi,

can you share the script as well

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader