Custom view is not being visible in context menu

Ananya Venkat
Tera Contributor

Hello,

I have created a new view (ServiceNow Change Management) for change request table and added all the required fields. This seems fine on dev instance but when I moved it to test instance, I couldn't see this custom view in the context menu at all. When I navigate to form design, i can find it. Is there anything I should do to make it appear on the context menu> views?

screenshot on dev instance:

find_real_file.png

but in the test instance, when I navigate to list view> context menu> view> I can't find this new custom view at all.

How to make it appear just as it is in dev?

 

4 REPLIES 4

Community Alums
Not applicable

Hi @Ananya Venkat ,

This might be of various reasons, i would check the following :

1. If any UI policy is restricting.

2. Check that you haven't restricted the view to a specific user or group.   Having the "admin" role doesn't grant complete visibility to everything.

3. Navigate to System UI-->View rules and check the Conditions of the particular view .Check the view rules if it is enabled. for this 

First you need to see in "Edit Module", you should have a "view name" and that "view name" should be in View Rules with the corresponding table.

And them in View Rules, you must to create a new rule and in the view you can write the name of the view that you want. In the "Edit Module" you can see too the Role that you must to have for change the view.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi @Sandeep Dutta ,

Thanks for the reply!

I created a view script as below

(function overrideView(view, is_list) {
    /*if (gs.hasRole("admin"))
        return;*/
    if (gs.hasRole("itil"))
        answer = "ServiceNow_Change_Management";
    else {
        answer = null;
    }
})(view, is_list);

with this, I can not select OOB default view , when I try with itil user, and then click on default view , it is showing this custom view as default view and OOB default view is not coming up. How do I rectify this. Also, the whole code should work only if a string field on change request form called "Jira ID" is empty. How do I add this particular condition too?

Community Alums
Not applicable

In your script by doing :

    if (gs.hasRole("itil"))
        answer = "ServiceNow_Change_Management";

You are actually setting the default view for ITIL users to be "ServiceNow_Change_Management" .

I think that's what you wanted right as per your original question.

 

I was expecting that default view exists and along with it, this new custom view can also be selected from the context menu. On the other instances, this new view was not being shown at all , I was not able to switch to this new view but I can switch to others like mobile view etc. 

Is there anyway I can show both OOB default view and this new view at a time so that users can switch as per their need? If this idea of showing both the default and new views can't happen, then i can proceed with making this new view as default view .

Could you please tell me how do I add any condition in the script? The whole code should work only if a string field on change request form called "Jira ID" is empty. How do I add this particular condition in the same script.

Does this work? (not sure if I can use current here)

if(current.u_jira_id==""){

if (gs.hasRole("itil"))
        answer = "ServiceNow_Change_Management";

}