Skip to main content

Posts

Showing posts from April, 2020

How to fix “Undeclared Property Error” when setting the Lookups with Dynamics 365 Web API

A very quick note to remind you about something really important when working with the Dynamics Web API, it is one of those things that you always forget to check until you spent 3 hours trying to figure out why it isn’t working. I was updating my code to create some related records after creating  a contact record and in one of the related entities I got this error: “An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property ‘YOUR FIELD’ which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.” This is caused because in my request I had the wrong field name,  please remember always use the schema name for the lookups! It is quite common for different people to create the fields in an entity and as I am sure you know Dynamics 365 tends to keep th...