Create draft cart for other user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2025 12:21 AM
Hi,
I want to create a draft cart for other user, so I used CartJS API. But after I run this script, this record only show admin's request list, I want this record display under employ B's request list. How can I resolve this?
var cart = new sn_sc.CartJS('draft_items');
var item = {
'sysparm_name': grRecord.getValue("number") + ' has been returned, this record is automatically generated',
'sysparm_id': grRecord.hr_service.producer + "",
'sysparm_quantity': '1',
'variables': variablesObj
};
cart.setRequestedFor(requestedFor); //this is sys_id of employee B
var cartDetails = cart.addToCart(item);
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 03:59 AM
Hi @Peter Xiang ,
For me, I added the user sys_id on:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 02:49 AM
Hi @Armando Cardos1 ,
Thanks for your update, this draft item display on my draft list, but when I click the draft record, here is an error message "You are either not authorized or record is not valid". Do I miss some actions?