- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 03:39 PM
Hi,
How can I auto populate a reference variable in a catalog Item field using a Catalog client script?
I want to display the manager of the current logged user.
I already managed to display the current logged user info.
This is the begining of the script :
function onLoad() {
g_form.setValue('current_user', g_user.userID);
g_form.setValue('current_user_manager', ..... );
}
Thanks for any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 05:45 PM - edited 01-30-2023 05:57 PM
You can also add default value in your reference variable to populate the manager of the logged in user:
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:06 PM
Hi @Ankur Bawiskar ,
In this case don't have any
is still Catalog Data lookup definitions possible?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:13 PM
Simplest Way
Use this in a default value of the manager Variable.
If my response helped please mark it correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 07:07 AM
Hi @Mohammed Amine1 ,
have you tried my solution with client script?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 08:10 AM
Yes I tried the GlideAjax .. It's working but I find te one with the javascript in default value easier.
Is there a best practice or a solution that performs better between client script (GlideAjax or GlideRecord) and the default value reference ?
Thanks.