Not able to get the requester name auto populate (onload) in service catalog on service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 10:21 PM
I have written a code in catalog client script under maintain item and the code is running on the native UI but not in the service portal.
My code is:-
function onLoad() {
//Type appropriate comment here, and begin script below
// g_form.setValue('requester_name', g_user.getFullName());
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', g_user.userID);
gr.query(call);
function call(gr) {
g_form.setValue('requester_name', g_user.getFullName());
while (gr.next()) {
g_form.setValue('business_phone', gr.phone);
g_form.setValue('email_id', gr.email);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 12:17 AM
Yes I have done this part but then also not getting the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:16 AM
Once your page is loaded on service portal, could you please open the console in browser and check if you are getting any error. Also could you please shate the screen shot of the client script page.
Regards,
Kamlesh