how to pass variables in service catalog item to sn_sc.CartJS() in Scripted REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 09:28 AM
Hi,
How to pass the variables of service catalog item to sn_sc.CartJS() .actually I am trying to call the sn_sc.CartJS() API in Scripted REST API.
I have to pass the four variables namely user,location,created by, action type,
Regards,
Phalguna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 11:20 PM
the above would help you placing the order and it would create REQUEST and RITM as well.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2020 01:50 PM
Hi Ankur,
Need your help.I'm having issue with one catalog item and it giving null pointer exception.
I see the null pointer error in log but how do I identify what is causing this and where to find the code for
sn_sc.CartJS();
I created new thread. Can you please provide some input?
Thanks,
Ashraf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 09:39 AM
Also, to get the REQ and RITM number from the submitted catalog item, you can use the below code to fetch both values
gs.print("REQ number is " + checkoutInfo.request_id); // This is REQ number
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('request.sys_idSTARTSWITH'+checkoutInfo.request_id);
gr.query();
if(gr.next()) {
gs.print("RITM number is " + gr.number); // RITM number
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2020 06:55 AM
Hope you are doing good.
Let me know if that answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2020 10:32 PM
Hope you are doing good.
Let me know if that answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader