How to get sys_id for record after g_form.submit()?

hamzaathar
Tera Expert

The sc_cat_item page on service portals allow users to submit a catalog item.

I am going through the code on the widget and it seems like the submit button calls g_form.submit() to produce the record.

 

How can I get the sys_id of the record if g_form.submit() is successful? I need to retrieve it in the same widget, preferably in the same function that calls g_form.submit().

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@hamzaathar 

the RITM sysId is not available until the catalog item is submitted.

what's your business requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Business requirement is to know the sys_id of the record generated by pressing the submit button on the sc_cat_item page.

@hamzaathar 

what's the purpose of getting that sysId?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Need it for a third party integration for attachments.