- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2014 08:52 AM
I am trying to set a condition on a client script so it will run for all users except for those with a specific company value set on their user account... and I cannot figure out what I am doing wrong!
Condition:
gs.getUser().getRecord().getValue('company') != 'CompanySysID'
Any Suggestions??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 08:51 AM
I would move the condition into the script itself:
if (g_scratchpad.userCompany.... (ps you had a typo in the screenshot example condtion, so fixing that might just work).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 08:51 AM
I would move the condition into the script itself:
if (g_scratchpad.userCompany.... (ps you had a typo in the screenshot example condtion, so fixing that might just work).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 08:53 AM
Looks like a typo in the condition g_scratchpad vs g_scrachpad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2014 11:24 AM
Also, you can use gs.getUser().getCompanyID() to return the company's sys_id:
Getting a User Object - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2014 10:20 AM
Alright, finally got it working. Thank you guys for all the help!
I fixed the typo and added the condition to the script itself rather than the condition line. For some reason a condition doesn't work in a condition line.... ( -__- )