setAbortAction not working with GlideAjax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 07:03 PM
We had put in two business rules to limit the actions of Demands so that the business properly completes them before closing the Demand. Specifically, the Demand needs to be properly Approved before it is Completed. And close notes are required when completing a Demand.
However, when we attempt to create a project from a Demand, we are noticing that the Demand is automatically set to complete. Naturally we thought the business rules would prevent creation of the project only to discover that is not the case:
It would appear that the "Create Project" link uses a GlideAjax to not only create the project, but to set the Demand to Complete. The question is whether setAbortAction (true) does not cover situations when a GlideAjax is initiated.
Advice on how to prevent the project entry from being created?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 09:26 PM
I way I suggested is the only way. Please discuss with your customer.
I believe it's a better user experience as well.
If you validate inside the UI action before the Ajax in that way users can see they are not supposed to create project and you can give proper message to them.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 07:35 AM
We may hide the UI action until a point where we allow the project to be completed. This will likely be when the Demand is completed, but the question is what exactly the flow will be.
Thanks