Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

OData date data type issue

Posted on by 14
I'm publishing OData and there is inconsistency date data type
 
some date data type result type=edm.Date and json file show empty string (/ /). some are showing /0001-01-01/ (this is the correct one).
 
How to solve this issue? is there anything wrong with database?
Categories:
  • Judy Profile Picture
    Judy Microsoft Employee on at
    OData date data type issue
    Hi angelo,
     
    Thank you for your feedback.
     
    It's hard to say what the root cause of the problem is, it is highly recommended that you can debug the code to verify if the OData publishing process is correctly mapping the date data type to the appropriate format in the JSON file.
     
    Best Regards,
    Judy
  • angelo_theus Profile Picture
    angelo_theus 14 on at
    OData date data type issue
    Hi Judy,
     
    the problem is that the result is inconsistent in Json Data for date data type.
     
    for example:
     
    "Birthday Date": "0001-01-01"
    "Posting Date": ""
     
    both fields are empty in Business Central interface but when we published the API, Json file shows as above. "Posting Date" should give value "0001-01-01".
  • Judy Profile Picture
    Judy Microsoft Employee on at
    OData date data type issue
    Hi,
     
    Please refer to the Microsoft Document to map the type between date type in Database and Edm.Date type through the CLR System.DateTime type:
    Hope it helps.
     
    Best Regards,
    Judy
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans