BR is not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 09:31 AM
Hi All,
I am trying below code.
var usr=gs.getUserName();
gs.addInfoMessage("usr"+usr);
var pc=new GlideRecord("cmn_location");
pc.addQuery('name',usr);
pc.query();
if(pc.next())
{
var flag=pc.name;
gs.addInfoMessage(flag);
}
else
{
flag=111111;
gs.addInfoMessage(flag);
}
Even though logged in user is available in location table still it is going to else loop. Any inputs on what I'm missing.
Same script is working in background script with hardcoded user name.
Thank you.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 03:03 AM
hello @Madhavi2
Good Day !!
var pc=new GlideRecord("cmn_location"); // here ur querying on location table
pc.addQuery('name',usr); // but here , name in location table represents the name of the location , see the attachment below.
so if you want to query the location table based on user name then add query with field name that contains user name as value.