Comments on: Change Form View Client Script https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/ ServiceNow Consulting Scripting Administration Development Wed, 06 Mar 2024 22:06:56 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: John https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7255 Tue, 13 Dec 2016 14:54:20 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7255 In reply to Mark Stanger.

That worked. Thanks!

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7254 Mon, 12 Dec 2016 22:42:55 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7254 In reply to John.

Check out this article. Your mileage may vary depending on the ServiceNow version you’re using but I’ve used this method successfully in the past.

https://servicenowguru.com/scripting/client-scripts-scripting/overriding-servicenow-form-view-inheritance/

]]>
By: John https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7253 Mon, 12 Dec 2016 21:48:07 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7253 Hi Mark,

Is there anyway to force a view on to a record in a related list? For example, if I’m in a view called ‘test’ for a company record and click on a company a related list, i don’t want to see the ‘test’ view, I want to see ‘default’ view.

Thanks,
John

]]>
By: Scott https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7252 Fri, 30 Oct 2015 03:03:21 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7252 Not having script in View Rules is a major oversight in the product, in fact the whole view management is poor IMHO.
It works well as long as you want to have one view for every end user and one for ITIL users and nothing else – everything else is a clunky kludge.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7251 Wed, 06 Aug 2014 23:23:24 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7251 In reply to Peter Foreman.

Role-based view rules for entire tables can be accomplished for lists in the system. An example of this is forcing non-roled end users to the ‘ess’ view of the incident table. You can check out the ‘incident functions’ global business rule to see how this is done and apply it to other tables as needed.

]]>
By: Peter Foreman https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7250 Wed, 06 Aug 2014 23:05:50 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7250 In reply to Mark Stanger.

Thank you for the reply. The list view can be specipied from the navigation panel modules, the Homepage filters but the URL is left open to manipulation.
Does it mean changing the Script Include: ViewManager, _listSelected function if you want to force a change to a list view ?
Say for a particular type of non-roled user, similar to what sys_script_ajax does for HomeScripts, homeGetViewName
Thanks Peter

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7249 Wed, 06 Aug 2014 04:09:10 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7249 In reply to Peter Foreman.

Not with view rules. View rules are based on the conditions of a specific record, which you can’t determine on a mixed result set in a list. You can force a view in a list view only by using the ‘sysparm_view=’ parameter in the URL that points to that list.

]]>
By: Peter Foreman https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7248 Wed, 06 Aug 2014 03:01:31 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7248 HI,
Is there a way to force the list view like there is for forms by using the View Rules module?
Thanks Peter

]]>
By: Akshat Chawla https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7247 Wed, 12 Jun 2013 05:20:58 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7247 Hi Mark,

I have the requirement to hide the filter on the basis of view for e.g I want to hide filter for every user on the ess view.
I wrote a script include i.e:
function incidentDisplayFilter() {
if (view.startsWith(“ess”))
{
answer = false;
}
else
{
answer = true;
}
return answer;
}

But my problem is that it’s working fine only for incident if I apply this for any other table it hides the filter for every view.

Thanks

]]>
By: Bill Collins https://servicenowguru.com/client-scripts-scripting/change-form-view-client-script/#comment-7246 Thu, 09 May 2013 06:33:34 +0000 https://servicenowguru.wpengine.com/?p=1831#comment-7246 (With a UI Action form button) I’ve tried the following and other variations to switch the view for a project record. The goal to to give the Project User the ability to toggle back and forth between the “project_report” view and the “default” view. It is not yet working.


//switchView('section','pm_project','project_report');
//gs.setRedirectURL("pm_project.do?" + current.sys_id + "&sysparm_view=project_report");

action.setRedirectURL("pm_project.do?sysparm_sys_id=" + current.sys_id + "&sysparm_view=project_report");

]]>