Setting different view on a Related List on a Form

Lavanya11
Kilo Sage

Is it possible to set a different view for the "Related Links" of the form without using "View Rule"?

12 REPLIES 12

You can switch to view using the below code in your related link UI action upon onClick

action.setRedirectURL('"table.do?sys_id=" + current.sys_id + "&sysparm_view=your custom view&sysparm_view_forced=true";

you can follow this as well 

https://servicenowguru.com/scripting/client-scripts-scripting/change-form-view-client-script/

please mark my answer as helpful/correct, if applicable

Regards,

Sai Kumar

sorry it's not working

can you plz share the script?

action.setRedirectURL("cmdb_ci_service_discovered.do?sys_id=" + current.sys_id + "&sysparm_view=HSY&sysparm_view_forced=true");

You have to write that script in script section not in onClick field, please change that.