Disabling Form Button.

DhathreshS
Tera Contributor

Hi Community,

 

I am working on a form which already has a customized button using UI Actions. When a new record is created the state is new and an approval will be automatically generated to the assigned group's manager, and I want to disable that button until the manager approves the request, I tried using a client script to get control over the button and disable it until the approval is set to approved but it didn't work. Can anyone suggest me a way to achieve this?

I attached the script used.

2 REPLIES 2

Jordan Vignoni
Tera Guru

Does the record change to a certain state once it is approved?  If so, you could add a condition on the UI action.  For example, if the record changes from "New" to "Approved", you could add current.state == 'Approved' as a condition, and then the UI action only shows when the record is approved.

No, the record does not change the state when the approval is approved. It just has to be able to change the state, the state changes when the user clicks on the button I mentioned and what is want to do is to disable that button until the approval is approved.