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

I have shared the script as well , can you pls take a look and tell me where I am doing wrong.. instead of getReference , what can should I use?

Hi,

in BR do this

g_scratchpad.SOM = current.u_service_offering.owned_by;

in client script you can use this to compare

Regards
Ankur

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

Hello,

g_scratchpad.SOM is giving me the correct sys_id of the current logged in manager

but from the client script I am not able to fetch the current value of the logged in manager.
getRefernce I cannot use , is there any other way to compare the values of the 

g_scratchpad.SOM and the client script value , how can i get the value on client script 

can you pls help by providing logic..

 

Hi,

in client script you are again getting owned_by from u_service_offering

but why as that is already being stored in scratchpad via BR

Regards
Ankur

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

okay , then what should I do in the client script.

How can I compare the value with stored g_scratchpad variable and which value to compare...

I am confused here .. can you pls elaborate