- 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-04-2021 02:36 AM
Spot On sir, i was not checking whether the order is actually placing or not . I relied on the logs and assumed that its not working as expected. Your findings were absolutely correct thanks a ton for your help.