Enable/Disable UI action buttons from client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2018 07:26 AM
Hi,
We've UI action button that is calling script includes.
Challenge is this UI action button has to be enabled/disabled based on if a field has value or not. How to accomplish this?
Thanks.
- Labels:
-
Scripting and Coding
- 3,718 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2018 07:30 AM
In any UI Action there is a Condition field, you can set your condition depends on a field value such as: current.field_name == value so it will be visible only if condition is true.
If you want to check if that field has a value or not you could simply use the not symbol (!), as :!current.field_name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2021 07:16 AM
p.s. minor edit. For checking field to be empty, had to use:
!current.field_name.nil()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2018 07:39 AM
Hi,
The condition of field should be updated to hide/display UI actions on the form.
current.some_field == 'some_value'
This would execute on the server side, so your form should be saved for it to work.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2021 07:00 AM
Is there a way to achieve this on client side?
If I don't want to save the form and just enable/disable a button based on an entry in the form currently, will it be possible to do this?