- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 11:19 AM
Hello!
Currently I am trying to query a user locations based off of the "requested_for" variable. The location of the user resides on the field "u_exp". The "requested_for" variable points to the sys_user table and is grabbing the logged in user as a default value. My final goal: If a user is from a certain location ex: US, then make another variable read-only and mark the checkbox true.
However I have not had any luck, even though I thought I was setting up the query correctly. Any help is much appreciated as I am new to the scripting.
Thanks!
var usr = g_user.userID();
var uq = new GlideRecord('sys_user');
uq.addQuery('sys_id',usr);
uq.query();
if(uq.next()){
alert(usr);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 05:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 02:37 PM
Hi Stephen,
The script seem to be ok, but not sure about the values in your form if you are using them correctly.
I would suggest to add log statement in the script include to check u_exp display value.
Also, you need to write an alert on the client script to check the answer or the response you are getting.
I highly recommend not to use dot walking in client script as dot walking will work upto only one level in client script and its not a best practice

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 11:34 AM
Hi Stephen,
can you try to write the glide query in script include and call it catalog client script using glide ajax.
writing glide query in client script in not a good practice.
if you have any further question please let me know
what is GlideAjax ?How to write Ajax function? | Ahmed Drar
https://snprotips.com/blog/2016/2/6/gliderecord-client-side-vs-server-side