业务中心集成字段映射CRM账户自定义字段

问题描述

我正在为 BC Customer 表扩展字段映射。我在我的 Dataverse 中添加一个 vatid 字段。我希望数据在 BC 客户增值税注册号和增值税之间双向传递。

我基于这个站点创建了一个程序并扩展了crm帐户表: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-custom-cds-integration

这是 CRM 帐户扩展代码

tableextension 50403 AccountExt extends "CRM Account"
{
    Description = 'Business that represents a customer or potential customer. The company that is billed in business transactions.';

    fields
    {
        field(50404; new_vatid; Text[100])
        {
            ExternalName = 'new_vatid';
            ExternalType = 'String';
            Description = '';
            Caption = 'VATID';
        }
    }
}

这是自定义字段映射代码

Codeunit 50402 IFMEFC
{

    [EventSubscriber(ObjectType::Codeunit,Codeunit::"CDS Setup Defaults",'OnAfterResetCustomerAccountMapping','',true,true)]
    local procedure HandleOnAfterResetCustomerAccountMapping(IntegrationTableMappingName: Code[20])
    var
        crmAccount_CRMAccount: Record "CRM Account";
        Customer: Record Customer;
        IntegrationFieldMapping: Record "Integration Field Mapping";
    begin

        InsertIntegrationFieldMapping(
        IntegrationTableMappingName,Customer.FieldNo("VAT Registration No."),crmAccount_CRMAccount.FieldNo("new_vatid"),IntegrationFieldMapping.Direction::Bidirectional,false);
    end;

    procedure InsertIntegrationFieldMapping(IntegrationTableMappingName: Code[20]; TableFieldNo: Integer; IntegrationTableFieldNo: Integer; SynchDirection: Option; ConstValue: Text; ValidateField: Boolean; ValidateIntegrationTableField: Boolean)
    var
        IntegrationFieldMapping: Record "Integration Field Mapping";
    begin
        IntegrationFieldMapping.CreateRecord(IntegrationTableMappingName,TableFieldNo,IntegrationTableFieldNo,SynchDirection,ConstValue,ValidateField,ValidateIntegrationTableField);
    end;

我已在我的 Business Central Cloud Microsoft 沙箱中发布了扩展,将 Business Central 连接到 Dataverse,运行了完全同步,并在完成后重置并再次运行。

同步未更改 Dataverse 中自定义字段的值或 Business Central 中的增值税注册号。他们保持不变。 我的 AL 代码中是否缺少用于同步自定义字段内容

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)