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
ā10-05-2020 03:10 PM
You could put console.log around it. So something like console.log(g_form.getValue('variablename'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-05-2020 03:32 PM
Thanks. Somehow it did not work before. I am able to execute the following code.
obj = g_form.getReference('caller_id');
obj.email.
I can get sysid of caller's department . Is it possible to get department name? For that I need to use again g_form.getReference(). But how does it knows this sysid is for department table.
I am assuming that getReference only works for field that exists on form and it is reference field with magnifyng lense. I just want to confirm. Appreciate it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-05-2020 04:22 PM
you could try obj.deparment.getDisplayValue(). However that may not work. Your best bet is to use a refence field the points to department table and then doing a g_form.setValue(obj.department). Since it is a reference filed it will display the name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-06-2020 02:05 PM
I tried g_form and it worked one time in Chrome console. Now both Firefox and chrome shows the following as soon as I type g_form on console command. It is easy to test with the console. Any idea on how to make it all the time?
I thought g_form is global variable and it should be avilable. I am sure it worked one time and tried couple of times to get the data using get_reference()
ReferenceError: g_form is not defined