Return to default value when ui policy returns false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 04:43 AM
I have yes/no type fields with in catalog and i have also set default value as none by checking the tick box.
Here i have a ui policy, where this yes/no field gets enabled when another field ("B") is chosen and user chooses yes or no.
When user selects someother value in ("B") field, this yes/no should come to default "none". How to achieve this?
Is there any return false script to be written?
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 05:55 AM
Yes, it does not return to default. hence the script to be used. Or you can create another UI policy where you add a condition that if B value is some other than yes/no, then create a UI action and set the value to default and enable it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 08:15 AM
Imran, did you try the above option suggested?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 06:36 AM
i am not following your requirement properly,
but if a field has default value and if the condition for reverse is true. than that field will be working as you desire to have.. seems like something else is causing the issue.
next question does filed B have choices?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 07:43 AM
I am having two fields A & B. Both A & B has drop down values Yes, No, None. None is by default. When A is yes, B field will be visible. Now i select Yes in B field.
Then i change my mind and select No in A field, whereas the value in B should be none. Instead it will be as Yes, as we selected before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 07:49 AM
You can do this in UI policy script or on change client script.
example
if (newValue == 'A' || newValue == 'B')
{
g_form.setValue('field name', '');
Mark the comment as a correct answer and helpful if it helps.