Getting sysid or RITM of just placed catalog item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 06:17 AM
I am using a custom UI Macro cart for a certain catalog item.
So instead of using the oob "catalog_cart_default", I copied it and created "catalog_cart_default_custom".
I'm using basically the same orderNow() function, but I need to capture the RITM (Requested Item) record that this produces.
How can I do this?
Here's the orderNow() function:
function orderNow()
{
var m = g_form.catalogOnSubmit();
if (!m)
return;
// Disable buttons
gel("order_now").onclick = "";
gel("save_this_record_button").onclick = "";
var item_guid = gel("sysparm_item_guid");
if (item_guid)
item_guid = item_guid.value
var catalog_guid = gel("sysparm_catalog");
if (catalog_guid)
catalog_guid = catalog_guid.value
var catalog_view = gel("sysparm_catalog_view");
if (catalog_view)
catalog_view = catalog_view.value
g_cart.order(gel("sysparm_id").value, getQuantity(), item_guid, catalog_guid, catalog_view);
saveThisRecord('submitted');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 06:32 AM
Hi David,
I don't know if that's possible from the client side here. Typically in order to get the sys_ids of the ritms ordered, you have to use the request sys_id that you get back from the catalog api and query for its items.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 06:38 AM
That'd be just fine. Where is it spitting back the request sys_id ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2017 07:03 AM
Did you find the solution ?
I also need the RITM record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 02:28 AM
After the cartDetails, you just need to do a GlideRecord to retrieve the RITM.
var cartDetails = cart.orderNow(request);
var GlideRecord('sc_req_item);
gr.addQuery('request', cartDetails.request_id);
gr.query();
if (gr.next()){
gr.number
}