How can we refersh the records in servicenow?

ravina _1
Tera Contributor

Hi All,
Can anybody help me to refresh the records in ServiceNow ?There is automated process which auto populates the location and department field when 'assigned to' field is set in alm_asset table form .This automated process work for new records but not work for old records ,so need to refresh the old records to achieve that functionality.

If I update a old record and save this new code works and populates location and department but there are around 45000 records .

What I can do to update all these records so this automation works for all the records?
Thanks in advance in reading my post.

ravina_1_0-1690396049111.png

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, it sounds like you have added a new before insert\update business rule to populate these fields if they are empty?
If you have added new functionality to your solution, then normal practice is to run a background or fix script against existing records to ensure that they are also updated\aligned, otherwise changes will only be applied when\if individual records are updated.
Your fix script or background script is probably a glidequey filtering for all records where these fields are not populated, then for each record returned by the query, set your field values\run a copy of your new script (or call it from your script if the code is a script include function), then update the record.
If not a scoped application, then in these scenarios you may also want prevent Workflow/Business rules from running with setWorkflow(false) and\or prevent the system 'update' fields from being populated with your details and current time using autoSysFields(false).