问题描述
我正在尝试通过 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):
验证输入参数时出错:Microsoft.OData.ODataException:导航属性“bpf_quoteid”没有扩展值,也没有“odata.bind”属性注释。请求中没有扩展值的导航属性必须有“odata.bind”属性注解。
其余的错误信息:
在 Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithoutValue(IODataJsonLightReaderResourceState resourceState,String propertyName) 在 Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.c__displayClass9_0.b__0(PropertyParsingResult propertyParsingResult,String propertyName) 在 Microsoft.OData.JsonLight.ODataJsonLightDeserializer.Processproperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector,Func'2 readPropertyAnnotationValue,Action'2 handleProperty) 在 Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState resourceState) 在 Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource() 在 Microsoft.OData.JsonLight.ODataJsonLightReader.ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAndAnnotationCollector,SelectedPropertiesNode selectedProperties) 在 Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector) 在 Microsoft.OData.ODataReaderCore.ReadImplementation() 在 Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action) 在 System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader) 在 System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader messageReader,Type type,ODataDeserializerContext readContext) 在 System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type,Stream readStream,HttpContent content,IFormatterLogger formatterLogger)
在我的例子中查找字段的架构名称都是小写的。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)