Set value for Date only field using Web API in Dynamics CRM 2016

By | May 4, 2016

Introduction:

In one of our previous blog we have shown how to set attribute values for different data types using Web API for JavaScript.

There is an exception that we are not able to set value for Date only field having behavior Date only in conventional way by assigning date object to the attribute as it will give you below error.Set value for Date only field

Even if we provide date in EDM format as shown below, issue still persist.Set value for Date only field using Web API

So we did research for the same and come across below work around to set value for Date only field having behavior Date only.Set value for Date only field using web api - crm

You need to provide value for the field in “YYYY-mm-dd” format which will work. In above example we have checked for OOB Birthdate field for contact which is date only field.

Conclusion:

If we want to set value for date time filed from CRM having behavior Date only using Web API, we have to pass date in “YYYY-mm-dd” format.

70% of global 2000 companies apply gamification to improve productivity and returns!

Gamifics365 – Spin the magic of games within Microsoft Dynamics 365 CRM to improve user adoption, enhance productivity, and achieve company goals!

One thought on “Set value for Date only field using Web API in Dynamics CRM 2016

Comments are closed.