Disable Approve button under conditions

Olivier Detille
Tera Contributor

Dear community,

I'm developing a scoped application that creates some catalog items that can be then requested. When one of those items is requested, a custom flow opens an approval.

I would like to implement a preventive control when the approver click on the approval button. Basically, I want to check for any policy violations and in case violations are found, i want to cancel the approval.

How can I execute a query / script / webservice call when someone clicks on the Approve button and based on the result cancel or submit the approval ? I've seen UI Policies, but they are global. 

Thanks for your kind answers

2 REPLIES 2

shun6
Giga Sage

Hi @Olivier Detille ,

Since the Approve button may be a UI Action, please write the required condition within the UI Action script.

I think this article will be helpful.

Solved: how to abort action in client UI Action? - ServiceNow Community

 

shun6_0-1742035202692.png

 

 

 

Olivier Detille
Tera Contributor

Thanks, I'll investigate that solution. I'm not yet familiar with UI Action, but will show some tutorials about it.