- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 08:56 PM
Hi All,
I have created a custom UI action for one of the forms and I have a requirement that once it is clicked by user it should be hidden/disable from that form. It should be hidden/disable even if opens the same record again. Please provide pointers on this like what needs to be done.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 11:24 PM - edited ‎08-15-2023 11:26 PM
@Kruthik M Shiva As you are trying to send email using UI action. You can create one Boolean field (True/False) in table on which you have created UI action. After your email sending code, you can add below code to update that boolean field in script section.
Field label- Email sent
Code-
current.email_sent = true;
current.update();
action.setRedirectUrl(current);
Put below expression in condition field
current.email_sent == false;
So now you have identifier as "Email sent" which will tell you that work of your UI action is completed and you can use the same in condition field of UI action to hide/show the UI action on form.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 10:01 PM
Hi @Kruthik M Shiva,
When you click the custom UI Action, do any of the record fields get set to a different value than before? If yes, we could probably use that as part of the UI Action condition and limit visibility.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 10:04 PM
Hi @Arpan Baishya ,
Thanks for replying, No once that UI action is clicked an email will be sent with some catalog item. In the current form nothing will be set.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 11:00 PM - edited ‎08-15-2023 11:11 PM
Well, even if nothing changes on the current record, you could check if something unique is happening with respect to the current record in the backend (which is probably why you don't want to display the UI Action again for that record). For example - an associated record from another table that can serve as a flag for displaying the UI Action or not.
If that's the case, you could write a function that performs this check and returns true/false, and include it in a Script Include. And then call it from the Condition field.
Since I am not fully aware of the specifics of the problem, I'm trying to give you a sense of direction in which you may want to proceed. Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 11:24 PM - edited ‎08-15-2023 11:26 PM
@Kruthik M Shiva As you are trying to send email using UI action. You can create one Boolean field (True/False) in table on which you have created UI action. After your email sending code, you can add below code to update that boolean field in script section.
Field label- Email sent
Code-
current.email_sent = true;
current.update();
action.setRedirectUrl(current);
Put below expression in condition field
current.email_sent == false;
So now you have identifier as "Email sent" which will tell you that work of your UI action is completed and you can use the same in condition field of UI action to hide/show the UI action on form.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!