Not able to get the requester name auto populate (onload) in service catalog on service portal

Community Alums
Not applicable

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);
}
}
}

6 REPLIES 6

Community Alums
Not applicable

Yes I have done this part but then also not getting the result.

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.

 

kamleshkjmar_0-1668503773011.png

 

 

Regards,

Kamlesh