
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 06:47 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 06:58 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 06:58 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 09:32 AM
@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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 08:26 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader