-
Notifications
You must be signed in to change notification settings - Fork 907
Prevent invalid field combinations #1816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent invalid field combinations #1816
Conversation
|
@bhavyaa30 - Description is Missing, Please add |
sure |
|
@am-shakeel I have added the description please have a look. |
am-shakeel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you Please add few more above Business Rule Type & all
Should I update in readme file or in PR description? |
|
Both please |
Updated! |
|
Just a quick note — we can actually achieve the same validation without script logic. If you define the condition directly in the Conditions tab and then use Set Abort Action in the Actions tab, it will block the record from saving just as effectively. |
Thanks for the feedback! I initially used a script so we could easily extend it with more complex validation logic in the future. That said, for this simple combination, using the Conditions and Actions tabs is a cleaner approach. I can update the Business Rule accordingly. |
am-shakeel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the submission! While the initial idea is valid, the current implementation is quite minimal and doesn’t introduce enough unique script logic or scenarios beyond what’s already covered in the repo. Since similar patterns already exist and this doesn’t add much new value, Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.
PR Description: This PR introduces a server-side Business Rule on the Incident table that prevents users from submitting or updating records when certain combinations of field values are logically inconsistent.
For example, it blocks the submission of incidents where Impact = Low and Priority = High, ensuring logical and process-consistent data is stored in the system.
Implementation Details
Business Rule Name: Prevent Invalid Field Combinations
Table: incident
When: Before
Insert: ✅ Checked
Update: ✅ Checked
Advanced: ✅ Checked
Execution Type: Synchronous (runs on server before the record is saved)
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions