Best Practice for UI Policy Inheritance Rule.

cloudboy
ServiceNow Employee
ServiceNow Employee

I have one question related with UI Policy (in case of Extended tables)

I have extended one table eg resource_plan and new table is ext_resource_plan, here by default the inherited is set to false in UI policy, so i need to make a copy of those UI polices in extended table also. 

I want to know the best practice, should we change the inherit to true so that extended table forms will get those rules as well OR copy the UI policy from base table, here if we set inherit to true we will miss future upgrades.

What would be the best way to handle this situation.

 

 

1 ACCEPTED SOLUTION

Fabian Kunzke
Kilo Sage
Kilo Sage

Hello,

To keep it short: In general, code duplication should be avoided. Therefore i personally would flag the ui policy as inheritable. BUT note, that on an upgrade this might pop up as an issue since modyfying oob ui policies could lead to collisions on upgrades. If you want to make it as clean as possible, deactivate the oob ui-policy, copy it, rename it and then flag it as inheritable. This will avoid any collisions but will prevent automatical updates from upgrades.

Just creating a new UI Policy which does the same thing as the original one is a possibility and technically unimpactful to the instance. So to give you a clear answer: both versinos have drawbacks, but from a maintainability perspective code duplication should generally be avoided.

Hope this helps.

Greetings

Fabian

View solution in original post

2 REPLIES 2

Fabian Kunzke
Kilo Sage
Kilo Sage

Hello,

To keep it short: In general, code duplication should be avoided. Therefore i personally would flag the ui policy as inheritable. BUT note, that on an upgrade this might pop up as an issue since modyfying oob ui policies could lead to collisions on upgrades. If you want to make it as clean as possible, deactivate the oob ui-policy, copy it, rename it and then flag it as inheritable. This will avoid any collisions but will prevent automatical updates from upgrades.

Just creating a new UI Policy which does the same thing as the original one is a possibility and technically unimpactful to the instance. So to give you a clear answer: both versinos have drawbacks, but from a maintainability perspective code duplication should generally be avoided.

Hope this helps.

Greetings

Fabian

Thanks fabiankunzke for the suggestion. It helps!