- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:42 AM
Hi All,
I have a service catalog. now in a reference field pointing to core_company table. I want to populate current user's company name ...
I need a suggestion on this
Regards
Abhinab
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:48 AM
Hi Abhinab,
Put this "javascript:gs.getUser().getCompanyID()" in the default value of your field where you want to populate current users company name.
Hope it will help you.
Regards,
Swapnil
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:47 AM
Hello Ahbinab,
I would put this into default value:
myUserObject.getCompanyID() -- returns the sys_id of the current user's company
More on this topic: Getting a User Object - ServiceNow Wiki
Alternatively, you can create onChange client script and query sys_user table to find the current user, and fill his company
Regards,
Michal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:48 AM
Hi Abhinab,
Put this "javascript:gs.getUser().getCompanyID()" in the default value of your field where you want to populate current users company name.
Hope it will help you.
Regards,
Swapnil
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 12:57 AM
thia will only retruen sys_id