UI Builder - Button disappears without updating the server-side due to mandatory fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2025 06:26 AM - edited ‎01-31-2025 06:31 AM
Hello,
I have a problem with buttons that I created and I cannot find a way to resolve the issue.
Let me explain the issue.
I have a custom app with the following buttons:
I configured the visibility of these buttons on the "Component Visibility" of the Button Component. I scripted it and basically, if the state is "Confirmed", I hide Confirm button.
When I click on "Confirm" button, the state is moved to "Confirmed". It works fine if all mandatory fields are filled in correctly.
However, if one of the mandatory fields are missing, there is a problem! In this case, when I click on Confirm, the button disappears but the form stays the same because it cannot save the form. The result is as follows:
I used the OOB configurations that come from the Form Controller for this setting.
Because the Set Form Value action is on the client side, and the visibility script does not care if the form is saved, the button disappears without actually the form being updated to Confirmed. This causes the problem.
So, therefore, I thought maybe I needed to do the update on the server side. I created an Update record data resource and updated the record to Confirmed upon clicking the button but that bypassed all UI policies.
I need a solution where when the user clicks on Confirmed, the system should check if all mandatory fields are filled and only then it should update the State field on the server side directly. Or any other ideas?
Thank you.
Best,
Firat