- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:18 AM
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:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:01 AM
I was able to reach a solution by setting the following filter conditions on my business rule, have tested it across different scenarios and seems to be doing what I needed, thank you for you suggestion of using filters, wouldn't have thought of doing it this way otherwise:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 05:40 AM
the BR has interactive session check so it should work
Did you try that?
share how that message is shown
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-29-2025 05:50 AM
I'm unable to pull change request.state into the filter conditions, I only see change request as an option. I am thinking if I update the business rule script so that if change request state assess, do not execute display the message that might be the easiest solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 05:57 AM
Basically you can hide the New button from related list of Change task when CHG is in Assess State
That's the easier option
1) configure list control on that related list
2) add this script in the"Omit new condition" field. If this field is not on form then add it in form layout in default update set
Directly go to this and make the necessary changes
URL: https://instanceName.service-now.com/nav_to.do?uri=sys_ui_list_control.do?sys_id=986553fb0a0006417a879dc40c0d683a
// if CHG is active and state is not assess then show
if (parent.active && parent.state.toString() != '-4')
answer = false;
else
answer = true;
Output: New button is hidden when CHG is in Assess State
Note: If it's some other State and not Assess then use that value in script, but logic will be same
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-29-2025 06:01 AM
I was able to reach a solution by setting the following filter conditions on my business rule, have tested it across different scenarios and seems to be doing what I needed, thank you for you suggestion of using filters, wouldn't have thought of doing it this way otherwise:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:42 AM
Glad to help.
Please mark my response as correct so that it helps future members.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader