When the request type variable is selected as none in catalog form, then no options should appear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:24 AM
Hi All,
Problem : There is a variable named "Request type" with type as select box. It has 3 choices on catalog.
1. None
2. XYZ
3. MMN.
When I select None, then all the variables below variable "Request type" should be hidden.
When I select XYZ, then some 6 variables to be displayed below variable "Request type" .
When I select MMN, then some 6 variables to be displayed below variable "Request type" .
I have wriiten 3 UI policies with below conditions.
1st UI policy name : When its None.
I created condition -> <Request type || is || None> and created all policy actions which I wanted to hide. Set their visible to false.
Similarly did for the other two as well (XYZ and MMN)
The issue that happens :
1). When I click "Try it" :- When I select "none", some random variables appear (When actually it must not appear). Every time some different random variables appear
2). Second issue, when I select "XYZ", some unwanted variables appear, which I have not even created in UI policy action. To avoid their appearance , I still created them as UI policy action and made them false but still they appear
I also created a Client script as below for "None" but no luck
I am really struggling and stuck with this..... please suggest me, Thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 11:51 PM
Hi @Deeplaxmi ,
Let me sum it up. "None" options will hide all variables that are included in both "XYZ" and "MMN" options, no other variables. Both XYZ and MMN options contains some common variables.
So let's make an example like this:
Option XYZ: shows ABCDEF
Option MMN: shows CDEFGH
=> We have common variables are: CDEF.
1. Disable the Client script, you just need to use UI Policy, it will handle the hiding job for you.
2. Create 1 UI Policy [Request type is XYZ] with UI Policy action are variable A + B.
3. Create 1 UI Policy [Request type is MMN] with UI Policy action are variable G + H.
4. Create 1 UI Policy for [Request type is one of XYZ, MMN] with UI Policy action are variable C + D + E + F.
* Remember to tick "Reverse if false" in all UI Policies.
Please try it again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 08:38 PM
Hi @Deeplaxmi ,
Did you try my response above to see if it works? Really want to know so I can assist you to get this done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 04:34 AM
Hi, I am working on that, Thanks !
Thanks a lot for the assistance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 11:48 PM
To make it simple to understand and maintain, I would create 3 UI Policies, one for each "Request type". Start by creating the UI Policy for when the Request type is "-- None --". Set the Short description and Catalog Conditions, make sure "Reverse if false" is NOT checked (very important) and then add all the variables (except for Request type) as Catalog UI Policy Actions with the "Visible" field set to "false" (I've only added 3 in my test).
Make sure that policy is working when the item is first shown on screen. The variables should not appear:
Now go back to the UI Policy. Change the Short description to "Show Variables when Request type is MMN", change the Catalog Conditions and then right-click the form header and select "Insert with Actions":
This will create a new UI Policy with copies of the Catalog UI Policy Actions. Set the "Visible" field to the appropriate value:
Test the item again to make sure both UI Policies are working:
Go back to the new UI Policy, change the Short description to "Show Variables when Request type is XYZ", change the Catalog Conditions and select "Insert with Actions" again. Set the Visible field to the appropriate values and test the item once again:
Now the proper variables should appear when the Request type is selected. The important part is making sure the "Reverse if false" option is NOT selected. That means only 1 UI Policy will run to set all the variables properly. Having them all listed in each UI Policy ensures they are shown or hidden when appropriate. The "Reverse if false" option is tricky with a Select box variable. Having the UI Policies setup this way may seem like overkill, but they are simple to understand this way. No need to setup "shared" UI Policies for common items and try to figure out how the variables will be set based on if the condition matches or not.