- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 11:00 PM
Hi Folks,
I came across a scenario where I need to control the visibility and mandatory state of multiple fields.
This can be achieved using UI Policies, but in this case, I would need to create more than 10 UI Policies.
However, I’m able to achieve the same functionality using a single Client Script.
I understand that:
UI Policies are a configuration-based, low-code/no-code approach.
Client Scripts are a customization and scripting-based approach.
From a scalability and maintenance perspective, it seems easier to manage one Client Script rather than maintaining multiple UI Policies.
I would like to understand what would be the best practice in this scenario.
Should we go with multiple UI Policies for the sake of configuration, or is it acceptable to use a single Client Script for better maintainability?
Looking forward to your thoughts and suggestions.
Thank you
Keshav
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 02:51 AM - edited 04-25-2025 02:53 AM
Hello @Keshav72 ,
I recommend UI Policies, not matter how many you need to build.
Creating a script can be a bit quicker than creating UI Policies in some cases, but that is usually a one-time activity.
Reviewing and trying to understand the logic happens more often, and just looking at the UI Policy Actions for a table will give you a great overview that no script can ever give. Especially if you make good use of the Short description field.
Need to update the logic because one of the fields no longer needs to be read-only? Just do list-editing in the above screen to get it done in 3 seconds.
Also, there are some strategies to reduce the effort for creating the UI Polies.
Do some of the fields have the same condition for making them visible/read only/mandatory? In that case you can handle this with a single UI Policy.
In Catalog UI Policies you can even show or hide an entire container with multiple variables inside with a single UI Policy Action.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This doesn't answer the question and shouldn't be accepted.
