Deactivating list of records from Business rule

Nagashree5
Tera Contributor

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.

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

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?

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

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?

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.