How to get the view name of the form by using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 03:41 AM
Hi All,
For change table we are having two different views.So I want to get the view name by using script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2015 11:15 AM
Sure it does. In our instance there is a hidden element in the form html:
<input id="sysparm_view" value="" type="HIDDEN" name="sysparm_view"></input>
and there is a hidden element in the list view html:
<input type="hidden" value="" name="sysparm_view"></input>
So if we're looking at the Mobile list view, for example, we get:
<input type="hidden" value="Mobile" name="sysparm_view"></input>
And on form view:
<input id="sysparm_view" value="Mobile" type="HIDDEN" name="sysparm_view"></input>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 05:02 AM
hi I have created an UI action in approver form..." UPDATE RITM",
function displayRITMRecord() {
var dialog = new GlideDialogForm('Review & Update ', 'sc_req_item');
dialog.setSysID(g_form.getValue('document_id'));
dialog.addParm('sysparm_view','Approver'); ---- it works only for ITIL users and not for ESS users. So, used the below global business rule.
dialog.addParm('sysparm_form_only','true');
dialog.render();
}
created a global business rule as below to show the APPROVER view( in RITM ) to ESS approver when clicks on UPDATE RITM.
// populate the default value for the caller
function sc_req_itemGetViewName() {
if (gs.hasRole("itil"))
{return;}
if (view.startsWith("approver"))
{return;}
if (view == "sys_ref_list")
{return;}
answer = "approver";
}
function sc_req_item_listGetViewName() {
sc_req_itemGetViewName();
}
I dont see any luck in getting my APPROVER view shown to the end user through UI Action. Kindly help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2018 06:26 PM
More directly and without DOM dependencies:
g_form.getViewName()
or
GlideList2.get(yourListName).getView()