How to prevent users from submitting new change task record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:16 AM - edited 01-29-2025 04:17 AM
**submitted in wrong forum by mistake**
I need to prevent users from being able to create new change tasks where type = type A, these tasks can only be created automatically when a Change Request is progressed to the Assess state.
I have a before insert business rule that is running on the change_task table where the task type = type A to prevent submission & display error message, which works.
The issue I have is when a Change Request move to the Assess state, the change request is displaying the error message. the change task is being created automatically & and it shows in the change_task table as being created by the same user ID as the person creating the change req. I want this error msg to only be displayed on the change task itself where a user is creating it directly from the change_task table.
How can I prevent this error message from being displayed on the change request form when the change req state triggers the creation of the task type = type a.
Business rule is:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:48 AM
Hi @thrsdy1512
The BR is written on which table?
The BR Should be on change task table and add filter conditions
change_task_type || is || Peer Review
(function executeRule(current, previous /*null when async*/) {
gs.addErrorMessage('This task cannot be created by users. This can only be created by the system when progressing a Change request.');
current.setAbortAction(true);
)(current, previous);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP