how to retrieve view in business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2010 03:56 AM
Hi All
Anyway to retrieve view name in business rule? I tried current.view.name, view.name, sysparm_view.. but all cannot get the view. Anyone one can help?
Thank you.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2011 06:49 AM
I would greatly appreciate this too!
I have tried these to no avail:
var view = sysparm_view;
I need to get the view so I can perform some logic to set a reference qualifier as per:
http://wiki.service-now.com/index.php?title=Reference_Qualifiers#Advanced_Reference_Qualifiers
If the view is ess, then I only want to show certain things in my reference field.
Trying to get the view from a global business rule is turning out to be very challenging - any help appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2014 11:43 PM
If I am not wrong the following code will help to check for the view names in Business rule and based on the name we can derive the action.
if (view.startsWith("ess"))
return;
if (view == "sys_ref_list")
return;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2014 01:05 AM
var current_view = RP.getParameterValue('sysparm_view');
or
var current_view = RP.getViewID();
should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 06:07 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
‎07-12-2017 04:43 AM
HI javier,
Can you suggest me the view of the parent table in ui action.
Thanks,
Swati