- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:04 AM
I've created a new UI Action against the cmdb_model table where I've selected:
- Active
- Show update
- Client
- Form Link
For the onclick I just specified "showDialog()" and then in the script window, inside my showDialog() function, I'm trying to use the 'current' variable. I'm getting a runtime error that current isn't a defined variable.
How do I get access to the model that the person is currently viewing from the UI Action?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:09 AM
Hi Scott,
"current" is only available server-side. For client-side access to the current record, use g_form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:09 AM
Hi Scott,
"current" is only available server-side. For client-side access to the current record, use g_form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:10 AM
Scott,
Since you are using client side of UI Action, you need to use g_form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:11 AM
Hi Scott,
Please refer the below link for more info on how to use client & server in one UI action.
Client & Server Code in One UI Action - ServiceNow Guru
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 10:19 AM
Hi Scott, you can do that by grabbing the sys_id of the record in use by using:
g_form.getUniqueValue()
http://wiki.servicenow.com/index.php?title=GlideForm_%28g_form%29#getUniqueValue
That will give you the sys id of the model
Thanks,
Berny