Force update if no value change

Hafsa1
Mega Sage

I'm fetching custom table record using SOAP message and calling it form scheduled script.

It runs every 3 days and update/insert record in custom table which is having only 100-150 records. Now most of the records don't get changed frequently is source application, hence, it don't update record in servicenow. But we have a requirement that it should update all records every 3 days irrespective of whether record value get changed or not.

Can anyone suggest what to use in scheduled script to force update every record?

8 REPLIES 8

asifnoor
Kilo Patron

So technically your script is not being called bcoz no changes in source application or your script is being called but no updates happening?

Can you share your script once.

Muralidharan BS
Mega Sage
Mega Sage

Hi Hafsa,

Are you looking for  setForceUpdate(true), this updates without having to change a value on that record. 

Thanks

 

dhananjay21
Giga Guru

Hi Hafsa,

Have you tried updating the auto_sys_field like Updates aka sys_mod_count which keeps the update count of record. Which is achieve able by using setForceUpdate(true).

Hope this helps you. 

Hafsa1
Mega Sage

I have included logs in script and it gives log entry for all 110 records but not updating it as no values are changed as source. Testing with changing 2-3 records at source and it updates only those records only. So will using "setForceUpdate(true)" in script always update 110 records every time script will run?