- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2024 04:30 AM
Hi Everyone,
I am working on deactivating multiple records(10) from a business rule and looking for a solution to pass the sys_ids without hardcoding them directly in the script, as it’s not recommended by ServiceNow best practices. Aside from creating a system property to store all the sys_ids of the records, is there a more efficient approach to achieve this?
Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2024 04:50 AM
Using a System Property is the efficient and recommended approach. If the 10 records are uniquely identifiable by certain field values then you could add query criteria instead of retrieving the records using a System Property. The Business Rule causes me to pause as this sounds like a Fix / Background Script situation. Do you need to deactivate the same 10 records on a recurring basis - like every time a certain table record is inserted or updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2024 04:50 AM
Using a System Property is the efficient and recommended approach. If the 10 records are uniquely identifiable by certain field values then you could add query criteria instead of retrieving the records using a System Property. The Business Rule causes me to pause as this sounds like a Fix / Background Script situation. Do you need to deactivate the same 10 records on a recurring basis - like every time a certain table record is inserted or updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2024 05:23 AM
Hi @Brad Bowman ,
Yes, every time the BR runs, few records needs to be deactivated and few should be activated on a recurring basis. In this scenario add query wouldn't work, i will have to query with sys_ids only, for this I will go with system property as suggested. Thanks.