The CreatorCon Call for Content is officially open! Get started here.

How to FORCE a UI View in a module

Katie A
Mega Guru

We have a module on Change > Create New.

I would like to FORCE that module to ALWAYS open the create new form with the default view.

I edited the Application Menu and added the name of the view.

However, it does not work! If the user has another view (such as the approval view) open prior to clicking Create New, it stays with the previous view and does NOT force the default view.

I also tried sysparm_view=default

That did not work either.

How to force the view every time the module is open?

Screen Shot 2016-03-10 at 4.02.22 PM.png

22 REPLIES 22

fuzum
Kilo Contributor

Thanks for your help, sadly it didn't work out


module.JPG


remove the argument, that's needed for new records.  



Use the filter for showing only active records



Maybe create a new view with a single word name and try it in the View name field.


Hi Dave,



On our Create new module for the change_request table, we have an interceptor in place which asks If you want to Raise a Normal or a Standard change and directs to the relevant forms.   I've added the sysparm_view_forced and this seems to work great, and also stops users from being able to change the view when they are in the form - which we like.   However it also stops Admins from being able to select a different view.   Is it possible to implement the above, but it does not apply for people with the admin role?



Any help is greatly appreciated.



Thanks.



Sam


Community Alums
Not applicable

Use sysparm_view_forced = true in your argument.


http://wiki.servicenow.com/index.php?title=View_Management#gsc.tab=0



> check about switching views



Regards, Bharat


Haritha Kotturi
Giga Contributor

Hello,

 

Its working fine for me. check it once

link tyoe: New record

view name: default

Arguments: &sysparm_view_forced = true