azure-data-factory - Azure 数据工厂复制数据 - 无法将“System.String”转换为目标类型“Microsoft.Xrm.Sdk.EntityReference”
问题描述
我正在尝试在 Azure 数据工厂的复制数据操作中设置查找字段。
我得到的错误是
Failure happened on 'Sink' side. ErrorCode=UserErrorTypeConversionFail,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,
Message=,Source=,''Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The
attribute 'ks_supervisor' with value 'E3BEFA28-C7A6-EA11-A812-000D3A1BB8EF' cannot be converted from
original type 'System.String' to target type 'Microsoft.Xrm.Sdk.EntityReference'.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,''Type=Sy
stem.InvalidCastException,Message=Specified cast is not
valid.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,''Type=Microsoft.DataTransfer.Common.Sh
ared.HybridDeliveryException,Message=The attribute 'ks_supervisor' with value 'E3BEFA28-C7A6-EA11-A812-
000D3A1BB8EF' cannot be converted from original type 'System.String' to target type
'Microsoft.Xrm.Sdk.EntityReference'.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,''Type=Sy
stem.InvalidCastException,Message=Specified cast is not
valid.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,
关键部分是value 'E3BEFA28-C7A6-EA11-A812-000D3A1BB8EF' cannot be converted from
original type 'System.String' to target type 'Microsoft.Xrm.Sdk.EntityReference'
。
我的问题是如何在 D365/CDS/CRM 中设置查找字段值,如果它期望 EntityReference 类型的值?
我尝试了 CDS 连接器、Dynamics 365 和 CRM 连接器,但都导致相同的错误。我还寻找尝试将源值从字符串转换为 GUID 的方法,但我找不到方法,我不知道这是否会有所帮助,因为它是 GUID 而不是 EntityReference。源列来自“uniqueidentifier”类型的 SQL 表,但它会自动投影到字符串。
解决方案
我必须将“@EntityReference”添加到列映射中的目标列名。在此处查看 MSFT 提供的答案:https ://docs.microsoft.com/en-us/answers/questions/34069/azure-data-factory-copy-data-to-cds-cannot-convert.html?childToView= 34732#comment-34732
请参阅此处设置查阅列值的文档。它还显示了如何设置客户列值:https ://docs.microsoft.com/en-us/azure/data-factory/connector-dynamics-crm-office-365#writing-data-to-lookup-field
推荐阅读
- vuejs2 - 如何在描述中向这样的结构添加子菜单 - Vue,Quasar
- reactjs - 尝试将我的 REACT Webpack 应用程序部署到 heroku。一切都在本地工作,heroku 构建工作。但我得到一个 404 nginx
- python - GPSD 未响应新连接
- excel - 从一个工作簿复制到另一个工作簿时缺少命名范围
- python - PowerBI .pbix DataMashup 压缩目录
- azure - 在 Rest API 中使用通配符列出 Azure 数据湖存储中的文件
- java - 如何将 String[] 转换为 Point for TouchAction 命令
- php - php dom从循环中获取多个元素
- assembly - msp430 中的汇编否定
- ios - SwiftUI:滚动视图中的顶部锚定可调整大小视图