Requestor for not populating correctly using sn_sc.CartJS();

nirmal12720
Tera Contributor
var cart = new sn_sc.CartJS();
cart.setRequestedFor("ghjgjkgjgh68768768");
Requestor for not populating correctly in Requestor for field in Request using the above script.
 
Can anyone help me out !!
5 REPLIES 5

Omkar Mone
Mega Sage

That does not seem to be the sysid of user, can you make sure you add a valid sysid and confirm?

 Please check the below image and this link - https://developer.servicenow.com/dev.do#!/reference/api/xanadu/server/sn_sc-namespace/c_CartJSScoped...

OmkarMone_0-1736147170708.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@nirmal12720 

Script shared by you should work provided you give correct user sysId

The user should be active in sys_user

Can you try that and share the update again?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

nirmal12720
Tera Contributor

@Ankur Bawiskar @Omkar Mone ,

 

I just post that sys_id for a example, In real time, I mapped the correct sys_id.

@nirmal12720 

Is that user active and not locked out?

Can you share complete script?

If that doesn't work then you can update the requested_for field on RITM once cart is submitted via script.

You can get the JSON response, parse it and get RITM and update the requested_for field on RITM via GlideRecord

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader