Displaying the Preview icon via View Rule when the State is not On Hold

NehaSNOW
Tera Guru

Dear Members,

 

I have created the View "Sys_popup" which doesn't have the 'On hold reason' field. 

NehaSNOW_0-1777873054584.png

 

My requirement is if the State is not "On Hold" then the View "Sys_popup" should be displayed otherwise "Default" view should be displayed in the incident_list view.  

 

The issue is if the State = "On Hold" the "Sys_popup" view is displayed. Please suggest.

NehaSNOW_0-1777872952115.png

 

 

The View Rule I created is: -

 

(function overrideView(view, is_list) {
 
    if(state != 'On Hold'){
        answer = "Sys_popup";
    }
})(view, is_list);
 
Thanks,
Neha Pateria
1 REPLY 1

Tanushree Maiti
Kilo Patron

Hi @NehaSNOW 

This requirement is not feasible. 

The UI policy or client script does not execute on any view including sys_popup view.

By utilizing view rules, you cannot control the visibility of view lists in the form or list context menu.

 

So when the state is set to “On hold,” you can configure which fields are  needed to display in that view like wise in your case update form layout in incident view.

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: