How to set default value in catalog item form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 08:06 AM
Hi All,
In service catalog , catalog item form i created a variable set .It contains two fields named
1.user name--reference field --sys_user table
2.manager-reference field --sys_user table
i want to set default values for these fields as current login user.
i am able to get user name ,,i want to know how to get manager name and set as default value.
Thanks
U K

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 08:10 AM
create onLoad client script for that cat item. bolded is your variables names
function onLoad() {
var user = g_form.getReference('req_for', populateReqForDetails);
function populateReqForDetails(user) {
g_form.setValue('req_for_manager', user.manager);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 08:16 AM
Hi UK
Just go to the variable in the item and find the default value field
paste in
javascript: gs.getUserID()
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 08:17 AM
And if you want manager
javascript: gs.getUser().getRecord().getValue('manager');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 08:26 AM
Hi
Thaks for response,
It works for user name , but i want to get manager name.