how can I update legacy(old) records from server side script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 12:57 AM
Hi,
I have a string-type field in a form that stores the names of all the empty fields within that form. The names of these empty fields are captured using on load client script. I am able to store empty fields data that are available in the form it is working fine for a new record and when a record is opened or reloaded however it is not saving empty fields data to old records. We need to manually open all the record then it is getting saved in backend but I don't want that manual process I want that all the legacy(old) record should get updated with empty field data automatically. I tried using scheduled job but it was not working.
This is the client Script I have used for storing empty fields data in a string type field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:01 AM
the script is checking if the field has value in it
gr[i] == ''
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 07:16 AM
Yes it is checking the fields that has value in it but the issue is that I only want those fields which are visible on the form not all the available fields on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 07:39 AM
how can you determine that in background script for old records?
I don't think you can
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 03:17 AM
Is there any way we can reload all the record once because if we reload it then my on load script will update the field automatically but the issue is that I don't want to open all the records manually and then reload it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 04:09 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader