Custom 'Created date' field capturing incorrect values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 11:08 PM
Hi All,
I have a requirement to capture the 'Created' i.e sys_created_on values on a new field that captures only the created date and not the time stamp for reporting purpose, same with the updated and closed fields
So i have created a new Date field 'Created date' and configured a business rule to update this field value.
But this newly created date field is not capturing correct values, there is a difference of a day (lag) between created dates in custom field and OOB field.
Can anyone suggest. Below are the details.
Business Rule
Type - Before Insert
Script-
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 01:42 AM
Hello @sanvi
There is difference in timezone that's why.
Instead of copying it, just use "now Date()" - function from OOB.
OR
There are other ways also, you can use "GlideDateTIme() and then use "getDate()" method to just extract date from it.
I hope this answers your queries.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 02:24 AM
@sanvi - This is an expected behavior because of the Date field type is not based on the user timezone.
Say when the user timezone and system timezone matches then you won't experience the difference. when the user time zone and system time zone is different then you will see the difference.
Little more about GlideDate object is explained in the article below,
Thanks & Regards,
Vasanth