Run preventive controls when an approver click on the "Approve" button of an approval task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 09:41 AM
Dear community,
I'm quite new with ServiceNow development. I'm developing a scoped application. That application creates some catalog items that can be requested. When they are requested, a flow is executed, opening some approvals. I would like to control the behavior when someone click on "Approve". Basically, I need to check if the related request is not in violation of another one. In case my check returns some violations, I want to inform the approve and cancel the approval, leaving the approval open until the violation is manage.
What is the best way to do that ? I've seen some post talking about UI Policies. But as far as I can see, UI Policies must be created in the Global scope to interact with the sysapproval_approver table. I would like to configure everything from my scoped application.
Thanks for your kind answers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2025 12:05 PM
Basically, I need to check if the related request is not in violation of another one. In case my check returns some violations, I want to inform the approve and cancel the approval, leaving the approval open until the violation is manage.
Atul:What is the definition of a violation, such as incorrect values or something else? The method to address it depends on the definition of the violation, determining whether a UI policy or client script is the best approach.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2025 05:52 AM
Dear Atul, to me, a violation consist to execute an API call to an external system, send the information about the requested item and get from the external system wether or not this is authorized. Does that make sense ? Based on that, do you recommend an UI Action or a Script ? BTW, this has to be enforced wherever within the UI (either approval list or through the approval tasks in the ESC). Thanks