Date Created field cannot take dates in the past or future

JbDevelopsSnow
Tera Contributor

I am trying to understand why a date/time field that is currently on layout will not allow me to change the date to a date and time in the past.  Is there a way to disable this so that I can import offline records and overwrite the date/time field.

I have checked UI Policies, Business Rules and Client Scripts and cannot find where this is enabled.

1 ACCEPTED SOLUTION

Hi, if the field is custom IE starts with u_, then it would seem to be custom which means the community has no visibility of your configuration and how\why this is occurring.
If the field reverts after you click save then the most likely cause is a before update business rule,

I would copy the name of the field IE u_fieldName
Open 'Studio' and select any application scope (the scope is mandatory but not important)
Select Search > Code Search
and search for your field name with no table selected and Search in all applications = true

TonyChatfield1_0-1707698968762.png

 

Hopefully that will help you find the cause?

View solution in original post

4 REPLIES 4

Pratik Malviya
Tera Guru

Hi @JbDevelopsSnow , Could you please elaborate for which table this is happening. Is that a custom table or OOTB.

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks,
Pratik Malviya

Tony Chatfield1
Kilo Patron

Hi, unfortunately your post does not make your configuration or issue clear.
Is the datetime field one of the system timestamps IE sys_created_on or sys_updated_on?
if yes, you can only set these fields if you utilize autoSysFields(false) in global scope script

GlideRecord | ServiceNow Developers

or disableAutoSysFields() in a scoped app.

GlideQuery | ServiceNow Developers


If this is not your issue then please update this thread with clear and detailed information of your configuration\process\problem, so that the community can better understand and assist.

Hi Tony, thank you for your reply.  I have a date/time field on layout, whenever I try to update that field to another date and click save, the field automatically reverts the date back to the current date.  I need to turn off this logic in order to import data with creation dates before today.  This field seems to be a custom field since it starts with a u_

Hi, if the field is custom IE starts with u_, then it would seem to be custom which means the community has no visibility of your configuration and how\why this is occurring.
If the field reverts after you click save then the most likely cause is a before update business rule,

I would copy the name of the field IE u_fieldName
Open 'Studio' and select any application scope (the scope is mandatory but not important)
Select Search > Code Search
and search for your field name with no table selected and Search in all applications = true

TonyChatfield1_0-1707698968762.png

 

Hopefully that will help you find the cause?