Reputation: 99
I am trying to link a quote to a bpf instance through Dynamics 365 WebApi :
const data = {
"[email protected]": "/" + SelectedEntityTypeName + "s(" + SelectedControlSelectedItemReferences[0].Id.replace('{', '').replace('}', '') + ")"
}
Xrm.WebApi.updateRecord(BpfName, Bpf.businessprocessflowinstanceid, data).then(
function success(result) {
console.log("Instance of " + BpfName + " updated");
},
function (error) {
console.log(error.message);
}
);
In result I am getting this error (400) :
An error occurred while validating input parameters: Microsoft.OData.ODataException: The navigation property 'bpf_quoteid' has no expanded value and no 'odata.bind' property annotation. Navigation property in request without expanded value must have the 'odata.bind' property annotation.
Rest of the error message :
at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithoutValue(IODataJsonLightReaderResourceState resourceState, String propertyName) at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.b__0(PropertyParsingResult propertyParsingResult, String propertyName) at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func'2 readPropertyAnnotationValue, Action'2 handleProperty) at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState) at Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource() at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAndAnnotationCollector, SelectedPropertiesNode selectedProperties) at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector) at Microsoft.OData.ODataReaderCore.ReadImplementation() at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action) at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader) at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext) at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
In my case the schema name of the lookup field is all lowercase.
Upvotes: 2
Views: 1094
Reputation: 99
Well, please ignore me.
The answer is
[email protected]
instead of
[email protected]
(Do you see the missing 'o' ?)
But furthermore, you need to be on the right process stage to fill the quote. To update the process stage I recommand this blog post : https://carldesouza.com/using-javascript-to-go-to-next-stage-in-business-process-flows/
Upvotes: 4