Get sys_id before insert (Catalog Item in Cart)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 10:14 AM
Hello everyone
Is it possible to get the sys_id of a record before inserting it? I would like to get the sys_id of the record, which is created when a catalog item is added to the cart (sc_cart_item). I know, that this sys_id is on the form in a hidden field with the id "sysparm_item_guid". Since I'm not using the out-of-the-box form I cant access this field.
Any help is appreciated
Kevin
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 12:21 PM
What exactly are you trying to do? Could you post the code for your custom page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2015 12:43 PM
Hi Brad
I use a processor to get catalog items (and variables) from ServiceNow. The catalog item (including the form for the variables) is rendered in an AngularJS Application. To add Attachments to the request before adding the catalog item to the cart I need the sys_id of the record (similar to here: Adding attachment button to service catalog request )
Somehow ServiceNow seems to "know" which sys_id the record in the sc_cart_item table will get, even though the documentation states, that the sys_id is created when gr.insert() is called.
Thank you!