- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 11:19 AM
Hi Guys, I have a scenario where I need to set a field "Type" (of Boolean type) upon clicking on the "set" button on the form.
I would like to know if I can turn my button as "Unset" and revert the change made by "Set" (clicking on set button the ui action script sets the field "Type" to true). Please suggest. Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 01:19 PM
Hi,
I think easiest way to achieve this requirement is to use 2 UI Action buttons.
- UI Action 1: "Set"
- Condition: current.<boolan field technical name> == true:
- Script: g_form.setValue('type', false);current.update();action.setRedirectURL(current)
- Script:
- Condition: current.<boolan field technical name> == true:
- UI Action 2: "Unset"
- Condition: current.<boolan field technical name> == false:
- Script: g_form.setValue('type', true);current.update();action.setRedirectURL(current)
- Script:
- Condition: current.<boolan field technical name> == false:
I hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 01:19 PM
Hi,
I think easiest way to achieve this requirement is to use 2 UI Action buttons.
- UI Action 1: "Set"
- Condition: current.<boolan field technical name> == true:
- Script: g_form.setValue('type', false);current.update();action.setRedirectURL(current)
- Script:
- Condition: current.<boolan field technical name> == true:
- UI Action 2: "Unset"
- Condition: current.<boolan field technical name> == false:
- Script: g_form.setValue('type', true);current.update();action.setRedirectURL(current)
- Script:
- Condition: current.<boolan field technical name> == false:
I hope this helps!