I have a date field in my entity. When I choose a date in my form and display it in a data table, it shows up correctly. However, if I look at it in the CDS it shows up as 1 day earlier than the date I selected. How can I fix this?
Solved! Go to Solution.
Hi @Anonymous - can you confirm when you created your environment and could you possible include a screen shot of the two dates you're comparing?
There are known differences in running an app versus the portal where the date can be converted to the users local timezone, but I'd like to confirm its the same issue.
The environment was created on 4/2/2018.
I have attached two images: one that shows my form in view mode with the correct Start Date that I selected from a date picker when I created the form (7/15), and one that shows how the Start Date shows up un the entity (7/14).
In the CDS under the field property for my "Start Date" field, there is a dropdown called Behavior. I switched this from "User Local" to "Date Only". This fixed the issue and now the date is being saved properly. However, once I changed the Behavior to be "Date Only", I now receive the error message "An entry is required or has an invalid value" on my Start Date field when I run the app in play mode. This error does not occur when I run the app in edit mode. Can you help me figure out why this is happening?
The CDS entities save data in UTC time, where as we have setup time zone as AEST i.e. +10:00 UTC, hence when we push the data to D365 for Finance and operatiosn it throughs an error the valid to and fron date time fields are invalid.
This still needs to be fixed and unfortunately we are approaching go live date, but this bug is giving us problems, any way out or temporary solution suggestions will be appreciated
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200