Can i change request form view based on field value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 11:02 AM
Hi,
I need to change my req form view based on one field value. If the field value is true, need to change the form view. Based on that, created view rule. But it is not working.
Tried with client script...
function onLoad() {
var catlogitem = g_form.getValue('u_catalog_item_request');
if(catlogitem=='true')
{
var sys_id = g_form.getUniqueValue();
var url = 'sc_request.do?sys_id=';
url += sys_id;
url += '&sysparm_view=service_catalog&sysparm_view=service_catalog&sysparm_domain=null&sysparm_domain_scope=null&sysparm_record_row=4&sysparm_record_rows=2515546&sysparm_record_list=ORDERBYDESCnumber&sysparm_nostack=yes';
top.window.location = url;
}
}
Some how it is working but it opens a new page...because of that, nav menu, banner will not appear. I want to be on same page...and need to change form view.
I am using fuji.
Can anyone help me on this...Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 11:55 AM
From that screen, are you able to pull down the context menu and change views?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 12:07 PM
Yes Chuck... i am able to change views from this screen.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 02:31 PM
If you can change views manually, that verifies that the view rule is not working.
I feel like I'm missing something obvious. It's not this hard to set up a view rule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 11:05 AM
Hi Rakesh,
You may find below link helpful.
http://wiki.servicenow.com/index.php?title=Restrict_Form_Views_by_Role#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2016 11:10 AM
use window.open("your url goes here","_self");