Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Pre-Generated Table Sys ID before Submit of Record Producer Catalog form

subhadeep1618
Tera Guru

I have a record producer catalog form linked to change_request table.

I have uploaded a file in the "add attachments" of the form (in portal).

Even before I click on submit, I can see that a record has been saved in sys_attachment table where: table_name = change_request table_sys_id = a unique sys id

My question is:

How did ServiceNow know this table_sys_id ?

And, how I can read this table_sys_id within my client-side or server-side script -- (important) Before Submit ?


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.
4 REPLIES 4

Ankur Bawiskar
Tera Patron

@subhadeep1618 

if you are on portal then within the OOTB widget I think there is some line which generates the sysId and that comes in table_sys_id in sys_attachment

-> _generatedItemGUID

Widget: SC Catalog Item (search in that widget)

55.png

you can verify this using this onLoad catalog client script on your record producer

function onLoad() {

    var sysId = this.angular.element("#sc_cat_item").scope().data._generatedItemGUID;
    alert(sysId);

}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@subhadeep1618 

Glad to help.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

subhadeep1618
Tera Guru

@Ankur Bawiskar 

Sir, you are a genius. 

Thank you so very much -- I really needed this for a solution I'm developing right now.


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.

@subhadeep1618 

I came across this while navigating in community recently and it was shared by one of the community member.

Thanks to that person as well.

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