- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 10:41 PM
Hi Team,
I am using the below script to create an RITM using inbound email action, the problem i m facing here is its working perfect when i test it using background scripts, but when i do it as a email inbound action its giving the message "Create RITM using Cart API : did not create or update sc_req_item using current" and the target is showing empty (attached screenshot for reference. Please help me to fix the same.
createRequest();
function createRequest() {
var cart = new Cart();
// add in cart, substitute your cat item sys_id
var item = cart.addItem('3f7e8f5f1b325090b0f210e58d4bcb82');
// set requested for, substitute your requested for
//Set Variables in your Cart Item
cart.setVariable(item,'requested_for','6698154e1b82e850537edc25cc4bcb95');
cart.setVariable(item,'name_of_user','test');
cart.setVariable(item,'purpose','test');
cart.setVariable(item,'ad_account','True');
var cartmsg = "received from: TEST" ;
cart.setVariable(item,'comments',cartmsg);
cart.setVariable(item,'e_mail_address','test@snc.com');
cart.setVariable(item,'job_title','job title');
var rc = cart.placeOrder();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 10:49 PM
Can you check if the Target table is set on your Inbound Email Action? Judging from the message you get, it looks like it is set to sc_req_item.
If set, the Inbound action will check if a new Record is inserted in that table or updated and will use that as the Target record. Since you do not use any record from a table to insert or update, that message "Create RITM using Cart API : did not create or update sc_req_item using current" will display.
Can you check if the order is placed (if you can find it in the request and requested items table)? If so, then you could either set Target table to --None-- or determine what record you want to insert/update after the order and that could be your Target record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 10:47 PM
Possibly the user who is sending the email doesn't satisfy the Catalog Item's User Criteria
Refer below link for same issue and the solution
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
‎02-04-2021 01:30 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
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
‎05-27-2021 12:48 AM
This really helped!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 10:49 PM
Can you check if the Target table is set on your Inbound Email Action? Judging from the message you get, it looks like it is set to sc_req_item.
If set, the Inbound action will check if a new Record is inserted in that table or updated and will use that as the Target record. Since you do not use any record from a table to insert or update, that message "Create RITM using Cart API : did not create or update sc_req_item using current" will display.
Can you check if the order is placed (if you can find it in the request and requested items table)? If so, then you could either set Target table to --None-- or determine what record you want to insert/update after the order and that could be your Target record.