Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Customisation Dynamics Sales Integration - Insert Constant Value to BC table

(1) ShareShare
ReportReport
Posted on by 2,558
Hi All
I'm customising the integration between dynamics sales and BC. When a Order from Dynamics Sales comes into BC, I want set a field in BC with a static value . For example field on the sales header "CreatedByIntegration"set to true (boolean field)
 
tried below in integration table mapping but no success:
            InsertIntegrationFieldMapping(
                IntegrationTableMappingName,
                BCTable.FieldNo(CreatedByIntegration),
                DataverseTable.FieldNo(SubmitStatus),//not relevant
                IntegrationFieldMapping.Direction::FromIntegrationTable,
                'true', false, false);//set true on const 
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 14,028 Most Valuable Professional on at
    Customisation Dynamics Sales Integration - Insert Constant Value to BC table
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,351 Super User 2025 Season 1 on at
    Customisation Dynamics Sales Integration - Insert Constant Value to BC table
    Hi, hope the following can give you some hints.
    Dynamics 365 Business Central: Customizing an Integration with Microsoft Dataverse (Integrate custom tables)
    Business Central 2024 wave 1 (BC24): Add table and field mappings to existing integration tables (Dataverse)
     
    Thanks.
    ZHU
     
  • Samantha73 Profile Picture
    Samantha73 2,558 on at
    Customisation Dynamics Sales Integration - Insert Constant Value to BC table
    The event for the above code:
     [EventSubscriber(ObjectType::Codeunit, Codeunit::"CDS Setup Defaults", OnAfterResetConfiguration, '', true, true)]
        local procedure OnAfterResetConfiguration(CDSConnectionSetup: Record "CDS Connection Setup")
        var
            DataverseTable: Record "CRM Salesorder";
            BCTable: Record "Sales Header";
            IntegrationFieldMapping: Record "Integration Field Mapping";
            IntegrationTableMapping: Record "Integration Table Mapping";
            IntegrationTableMappingName: Code[20];
        begin
            IntegrationTableMapping.SetRange(Name, 'SALESORDER-ORDER');
            if IntegrationTableMapping.FindFirst() then begin
                IntegrationTableMappingName := IntegrationTableMapping.Name;
     
                IntegrationTableMapping.Validate(Direction, IntegrationTableMapping.Direction::Bidirectional);
                IntegrationTableMapping.Validate("Synch. Only Coupled Records", false);
     
                //---field values---
                //1.Synched by Integration set const value
                InsertIntegrationFieldMapping(
                    IntegrationTableMappingName,
                    BCTable.FieldNo(CreatedByIntegration),
                    DataverseTable.FieldNo(SubmitStatus),
                    IntegrationFieldMapping.Direction::FromIntegrationTable,
                    'true', false, false);
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,085 Super User 2024 Season 1 on at
    Customisation Dynamics Sales Integration - Insert Constant Value to BC table
    Hi,
    Can you share your code with with event, in which event you are trying?
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,234 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans