Cannot use getReference method on client script , Glide ajax is the other way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2022 10:05 AM
Hi
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 04:36 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 04:33 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 04:41 AM
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..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 04:45 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 04:51 AM
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