How to enforce a view in Problem Form without using View Rules

Aying
Tera Contributor

Hi,
We have a requirement to use different view (Instead of Default) for different users in Problem Form. Users should also be restricted from switching views as views. We used View Rules to implement this. However, the Modals on problem Form also enforced the view because of the view Rule. 

Aying_0-1720174652041.png


Any Idea on how we can fix this or enforce a view without using View Rule, so that Modals won't have issues?

1 ACCEPTED SOLUTION

The page displayed in the popup has sysparm_is_dialog_form=true parameter in the URL, which you can make use of in the script of your view rule:

(function overrideView(view, is_list) {

    if (gs.action.getGlideURI().getMap().get('sysparm_is_dialog_form') != 'true')
        answer = 'my_custom_view_for_problems';

})(view, is_list);

View solution in original post

6 REPLIES 6

James Chun
Kilo Patron

Hi @Aying,

 

Why do you need to apply a different view on the modal only?

Just trying to understand the business requirements here.

 

Cheers

Aying
Tera Contributor

Hi James.

Sorry for not being clear.

Our requirement is to have a Custom View on Problem Form (depending on user).

However, when we use View Rules to enforce the Custom View on users, it also applies to Modals and that is our issue. Custom View should only apply on Problem Form. But because of View Rules, it also shows on Modal.