sc.CartJS() Unable to find workflow version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2023 11:54 AM - edited ‎02-22-2023 11:54 AM
Dear all,
I have an issue when creating a request record and RITM when using sn_sc.CartJS()
var cart = new sn_sc.CartJS();
var newItem = cart.addToCart({
"sysparm_id": "017594ae0ff25b00a919f68ce1050e04",
"sysparm_quantity": "1",
"sysparm_requested_for": "a29b5e74db18f8507ad764ebd3961902",
"variables":{
}
});
var checkoutInfo = cart.checkoutCart();
Getting error:
Unable to find workflow version for 73017d1037023000158bbfc8bcbe5dce (user=14ad7908dbe615107ad764ebd39619e7)
The workflow is in the true state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2023 07:57 PM
are you saying when RITM gets created using the above script the workflow is not triggering?
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-22-2023 11:59 PM
Hi Ankur,
ty for your answer.
yes, that is correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2023 12:05 AM
I hope you have linked the workflow to your catalog item and it's in Published state
can you try to use cart API
try{
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
//add your requested item to the cart by sys_id of the catalog item
var item = cart.addItem('017594ae0ff25b00a919f68ce1050e04', 1);
cart.cart.requested_for = 'a29b5e74db18f8507ad764ebd3961902';
var rc = cart.placeOrder();
gs.info(rc.number);
}
catch(ex){
gs.info(ex);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-23-2023 01:43 AM
Thank you for your quick response.
Yes, this is working fine. This method, however, will be deactivated by ServiceNow.
Therefore sn_sc.CartJS(); ,which does not work.