Microsoft Dynamics Web Api - 导航 属性 'bpf_quoteid' 没有扩展值,也没有 'odata.bind' 属性 注释

Microsoft Daynamics WebApi - The navigation property 'bpf_quoteid' has no expanded value and no 'odata.bind' property annotation

我正在尝试 link 通过 Dynamics 365 WebApi 引用一个 bpf 实例:

const data = {
            "bpf_quoteid@data.bind": "/" + 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);
            }
        );

结果我得到这个错误 (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.

错误消息的其余部分:

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)

在我的例子中查找字段的架构名称全部小写

嗯,请无视我。 答案是 bpf_quoteid@odata.bind 代替 bpf_quoteid@data.bind

(你看到失踪的 'o' 了吗?)

但此外,您需要处于正确的流程阶段才能填写报价单。 要更新流程阶段,我推荐此博客 post : https://carldesouza.com/using-javascript-to-go-to-next-stage-in-business-process-flows/