Forum Discussion
Ermac15
Aug 18, 2023Copper Contributor
Render Template Request using Query Parameter failed.
I'm trying to execute the render template request using POST method and data in JSON format in which I have used fetchXml, QueryApi, and QueryParameter as shown below.
{
"Template": {
"@odata.type": "Microsoft.Dynamics.CRM.documenttemplate",
"documenttemplateid": "3b7b5626-9519-ee11-8f6e-00224802aafe"
},
"FetchXml": "<fetch version='1.0' output-format='xml-platform' mapping='logical'><entity name='invoice'><order attribute='name' descending='false' /><attribute name='name' /><attribute name='totalamount' /><attribute name='customerid' /><filter type='and'><condition attribute='ownerid' operator='eq-userid' /><condition attribute='statecode' operator='eq' value='0' /></filter><attribute name='customerid' /><attribute name='statuscode' /><link-entity alias='invoicecustomeridcontactcontactid' name='contact' from='contactid' to='customerid' link-type='outer' visible='false'><attributename='emailaddress1'/></link-entity><attributename='invoiceid'/></entity></fetch>'",
"QueryApi": "",
"QueryParameters": [{
"sort_by" : "name"
}]
}
When i executed the above request the below error occurred.
{
"error": {
"code": "0x80048d19",
"message": "Error identified in Payload provided by the user for Entity :'', For more information on this error please follow this help link https://go.microsoft.com/fwlink/?linkid=2195293 ----> InnerException : Microsoft.OData.ODataException: Does not support untyped value in non-open type.\r\n at System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty property, IEdmStructuredTypeReference resourceType, Object resource, ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ApplyStructuralProperties(Object resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ReadResource(ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.ReadEntry(ODataDeserializerContext readContext, ODataParameterReader reader, IEdmOperationParameter parameter)\r\n at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)."
}
}
Any help would be really appreciated!
No RepliesBe the first to reply