Testing g_form in Chrome console
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-05-2020 03:02 PM
Is it possible to invoked methods on g_form in the console of chrome? I tried and it did not find the object. Wondering if there is any wrapper or in anyway. Appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2023 02:45 AM
Hello Community,
to use the g_form in the browser console, it is (sometimes) necessary to change to the gsft_main frame.
Therefore, take a look at the following ServiceNow Knowledge Article:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0695239
Then it is possible to create e.g. an alert - alert(g_form.getValue('<variableName>')); - or
to print something - console.log(g_form.getValue('<variableName>')); - to the browser console.
Do not forget the single quotation marks 'š'.