Conflicting UI Policies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2022 10:59 AM
Hello,
I have two fields in the incident record form: "description" (String Type) and "u_description" (HTML).
Following are my conditions:
- when priority is 1 or Priority is 2, I need description to show, and u_description to hide
- When priority is NOT 1 or 2, I need description to show and u_description to hide
- Problem is, all priorities have the following fields mandatory. So far I have been unsuccessful to achieve 1 and 2, and I can truly use some help. I have tried so many ways to achieve it and been unsuccessful.
- One of the main problem I am having is when the priority is not 1 or 2, and let's say I fill in all the information and hit save. The "Description" field doesn't save the content, the content disappears.
Screenshots:
Fields all except u_description were already part of our incident record:
Following is the UI Policy I am using to show the ui_description and hide the description
Any help you can provide is much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 01:22 PM
Hi Sam, based on what you have mentioned it appears like that you u_description will not be visible in any scenario and description will be visible in all the scenarios.
If that is the case your big ui policy should be good enough
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 08:47 PM
Hi,
You can remove the mandatory description for P1 and P2 from Mandatory one UI policy and while writing UI policy for hide or visible use the mandatory in that one only.
because if the field is already mandatory then you can't hide the value.
Thanks,
Sumit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:12 PM
Hi Sam,
Try to filter the common conditions from all of your conditions and then you can change order and try them. In case if its not possible via UI Policy then you can prefer Client script.
Below is a post which show how to hide a mandatory field. you can create your client script with all your conditions using "If Else":
Also, If you are trying to hide a field which is mandatory through script then you will have to first make is non mandatory and then hide it in the script and make sure that for the same condition there is no UI Policy exists because the order of UI policy is higher so it will override the client script condition.
Note: Using Client script is not the best practice but in these type of scenario many people use client script.
Thanks,
Prashant.
Mark my answer correct & helpful if it gives your solution.