Possible to Add Functions to gs or g_form Objects?

G24
Kilo Sage

Hello JavaScript wizards,

 

Is it possible, at runtime, to add additional properties or methods to the magical gs or g_form objects?  Seems like with JavaScript this should be possible.

 

I would like to add properties and methods in one script, and then have those become available for use in another script.  But maybe gs and g_form in one script is actually a different "instance" than in another script.  Probably.  Don't know.  Please educate me.  Thanks.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@G24 

Nope it's not possible.

the code for those is coming from platform and we don't have access to it

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@G24 

Nope it's not possible.

the code for those is coming from platform and we don't have access to it

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

G24
Kilo Sage

@nowgpt1 and @Ankur Bawiskar Thank you.

Do you know if it would be possible to create a class/object in one script, stuff it into the scratchpad, pull it OUT of the scratchpad in a different script, and then call functions on it?  Thus creating a global library object?

@G24 

Thank you for marking my response as helpful.

As part of new community feature you can mark multiple responses as correct.

Please mark my response as correct if it helped.

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