Force update if no value change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2020 09:50 PM
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?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2020 10:03 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2020 10:05 PM
Hi Hafsa,
Are you looking for setForceUpdate(true), this updates without having to change a value on that record.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2020 10:09 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2020 10:35 PM
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?