Could not specify 2 views for 2 modules of same table

bcmc01
Kilo Expert

We have a table with list of Records. 2 different groups should see different views based on their roles. As shown in images, the table "posts" has 2 views "My Posts" and "Risk Admin". I created 2 modules with different names under application menu and mentioned view name in   "View Name" field. But when I open them, I could see only one view applied. I can change views in List Control, when I change it applies across the table where ever it's used. It looks like View Name does not have an impact on this. I thought of using ACL to restrict but I could see an error message   "Security constraints prevents you from viewing this", which looks bad in front of customer.   Can anyone help me?

Posts Module:

Screen Shot 2016-10-18 at 11.59.29 AM.png

List Of Records:

Screen Shot 2016-10-18 at 11.59.01 AM.png

Posts(RiskAdmin module) :

Screen Shot 2016-10-18 at 11.58.46 AM.png

1 ACCEPTED SOLUTION

LaurentChicoine
Tera Guru

Try impersonating your target users. As an admin you can select a view and this will apply as a user preference that will bypass the view you did setup in the module. So your users might be alright with the configurations you made.


View solution in original post

9 REPLIES 9

BALAJI40
Mega Sage

In stead of that create one module, create view rule


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


I followed the process mentioned in above link. However I got below error. Does this work on scoped application? If yes, do we have any syntax changes?



org.mozilla.javascript.EcmaError: "view" is not defined.


Caused by error in Business Rule: 'Risk Admin Form View' at line 3



1: function onDisplay(current, g_scratchpad)


2: {


==> 3: x_22344_a_b_c_post_listGetViewName();


4: }


5:


6: function x_22344_a_b_c_postGetViewName()


BALAJI40
Mega Sage

This one i created view rule for incident module,


try to create same thing for your module, it will be easy and change dynamically.


system ui --> view rules --> create new


find_real_file.png


Well, I am in FUJI, so I can not see 'Advanced' check box.