Feature/Preserving System Fields During Updates#2079
Feature/Preserving System Fields During Updates#2079SumithThota wants to merge 1 commit intoServiceNowDevProgram:mainfrom
Conversation
ravichandra1998g
left a comment
There was a problem hiding this comment.
we appreciate the effort you’ve put into this contribution. We’ve labeled it as hacktoberfest-accepted so it still counts toward your Hacktoberfest progress. Thank you for contributing!
This will not be merged as these are well known standard methods to stop system filed updates and there are many - examples of this use case in ServiceNow Community.
For Hacktoberfest, we’re aiming for high-quality contributions providing real-world use developer cases.
You can see some of the recently merged PRs to know the kind of code snippets we are aiming for.
Please reopen/ submit a new one after adding more dynamic context/use cases that are more suitable for the open source
Expanded Snippets: Code snippets reused from the ServiceNow Documentation or API References are acceptable only if they are expanded in a meaningful way (e.g., with additional context, documentation, or variations).
|
Hi @ravichandra1998g, |
PR Description:
This background script pattern demonstrates how to update user editable fields on a record while preserving system managed fields (such as sys_created_by, sys_created_on, sys_updated_by, sys_updated_on, and sys_mod_count) and avoiding unintended side effects.
Overview
When programmatically updating records you may want to:
This snippet shows a conservative approach: copy only allowed fields from a source object, avoid writing system fields, and use GlideRecord's update operations safely.
Proposed Script
Screenshot
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions