API: https://beftest.api.crm.dynamics.com/api/data/v9.2/products
Method: POST
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
Accept: application/json
Body/Payload:
{
"[email protected]": "/products(070110042504)"
}
Requirement:
Error:
message": "Error identified in Payload provided by the user for Entity :'products', For more information on this error please follow this help link https://go.microsoft.com/fwlink/?linkid=2195293 ----> InnerException : Microsoft.OData.ODataException: An ODataPrimitiveValue was instantiated with a value of type 'Microsoft.OData.ODataEntityReferenceLink'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types.rn at Microsoft.OData.ODataPrimitiveValue..ctor(Object value)rn at Microsoft.OData.ODataValueUtils.ToODataValue(Object objectToConvert)rn at Microsoft.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.AttachODataAnnotations(IODataJsonLightReaderResourceState resourceState, String propertyName, ODataPropertyInfo property)rn at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadNestedPropertyInfoWithoutValue(IODataJsonLightReaderResourceState resourceState, String propertyName, IEdmProperty property)rn at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithoutValue(IODataJsonLightReaderResourceState resourceState, String propertyName)rn at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.<ReadResourceContent>b__0(PropertyParsingResult propertyParsingResult, String propertyName)rn at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func`2 readPropertyAnnotationValue, Action`2 handleProperty)rn at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState)rn at Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource()rn at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAndAnnotationCollector, SelectedPropertiesNode selectedProperties)rn at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector)rn at Microsoft.OData.ODataReaderCore.ReadImplementation()rn at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)rn at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)rn at Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)rn at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger).
Tried:
The GET is working as expected.
I tried to modify the payload but no results.
Expectation:
201 Code
New contributor
sanchari biswas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.