How to set custom value for sys_created_on field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 08:30 AM
For some business situations, we have to make some ad-hoc entries in a table. These entries should have custom value for sys_created_on field. I tried followings:
1. Inactive the ACL *.created_on: Didn't worked.
2. Return true from the ACL *.created_on script section: Didn't worked.
Any idea?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 09:17 AM
Hello,
It is not advisable to modify system fields functionality. But if you really need to do so, may I know how do you want to set the custom value for the sys_created_on field?
Regards,
Diane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:19 PM
I would like to set the value by script and there can be some business logic like 3 days past form current date. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 12:27 PM
var gdt = new GlideDateTime(current.sys_created_on);
gdt.addDaysUTC(-2);
current.sys_created_on = gdt;
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 03:02 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar