web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to bypass "Auto. Accept Transactions" when posting Intercompany Journals via AL Code

(8) ShareShare
ReportReport
Posted on by 2,977 Super User 2026 Season 1
Hi All,
 
In Business Central, when an Intercompany Journal is posted, the system checks the "Auto. Accept Transactions" setting on the IC Partner card. If this flag is enabled, the transactions are automatically accepted into the partner company’s inbox. I want to bypass this via AL Code.
 
 
Problem Statement -

In my scenario, I want to bypass this behavior — meaning the transactions should be sent to the IC Inbox, and gets automatically accepted, regardless of whether the partner’s "Auto. Accept Transactions" setting is enabled or not. I need this to work on one IC Journal Template and Batch only.

Has anyone implemented a solution or customization to override this logic in the Partner Company?

Also, I have already traversed the whole IC Journal Posting, and I got to see that this is checked in the codeunit 790 - "IC Inbox Outbox Subscribers", but there is no IsHandled variable for skipping this part for me.

[EventSubscriber(ObjectType::Report, Report::"Move IC Trans. to Partner Comp", 'OnICInboxTransactionCreated', '', false, false)]
    local procedure AcceptOnAfterInsertICInboxTransaction(var Sender: Report "Move IC Trans. to Partner Comp"; var ICInboxTransaction: Record "IC Inbox Transaction"; PartnerCompanyName: Text)
    var
        ICPartner: Record "IC Partner";
        TempRegisteredPartner: Record "IC Partner" temporary;
        FeatureTelemetry: Codeunit "Feature Telemetry";
        ICMapping: Codeunit "IC Mapping";
        ICDataExchange: Interface "IC Data Exchange";
    begin
        ICPartner.SetRange("Inbox Details", PartnerCompanyName);
        if not ICPartner.FindFirst() then
            exit;

        ICDataExchange := ICPartner."Data Exchange Type";
        ICDataExchange.GetICPartnerFromICPartner(ICPartner, TempRegisteredPartner);

        FeatureTelemetry.LogUptake('0000IIX', ICMapping.GetFeatureTelemetryName(), Enum::"Feature Uptake Status"::Used);
        FeatureTelemetry.LogUsage('0000IIY', ICMapping.GetFeatureTelemetryName(), 'IC Inbox Transaction Created');

        if TempRegisteredPartner."Auto. Accept Transactions" then
            if not IsICInboxTransactionReturnedByPartner(ICInboxTransaction."Transaction Source") then
                ICDataExchange.EnqueueAutoAcceptedICInboxTransaction(ICPartner, ICInboxTransaction);
    end;
 
I have the same question (0)
  • Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at
    It uses the interface to retrieve the Registered Partner. If you can implement the IC Data Exchange Partner interface to update the GetICPartnerSetup, you can adjust the boolean on the Temporary record. Try that method.
  • Aman Kakkar Profile Picture
    2,977 Super User 2026 Season 1 on at
    Hi Suresh, Thanks for your response.
     
    That was my question - how to make the changes in that Temporary record or to completely bypass the Job Queue logic that standard uses. Currently, I do not have any privilege to make any changes in this process. Can you share a code snippet if possible, as it will help me a bit more to understand the approach?
     
    Thanks again.
  • Suggested answer
    YUN ZHU Profile Picture
    99,049 Super User 2026 Season 1 on at
    Hi, this can be submitted to Microsoft.
     
    Hope this helps.
    Thanks.
    ZHU
  • Verified answer
    Rishabh Kanaskar Profile Picture
    6,219 Super User 2026 Season 1 on at
    Hi,
     
    You cannot reliably change the built-in check (no IsHandled) at the point it runs. Recommended approach: leave standard flow intact and add your own small process that finds new IC Inbox transactions for the specific Journal Template+Batch and calls the partner’s IC Data Exchange enqueue method to accept them regardless of the partner flag. Run it immediately after posting (Job Queue or called from your posting flow). This avoids modifying base logic and works per-template/batch.
     
    AL pattern:
     
    codeunit 50150 "IC AutoAccept Runner"
    {
        SingleInstance = true;
        procedure Run(AFilterTemplate: Code[20]; AFilterBatch: Code[20])
        var
            ICInboxTrans: Record "IC Inbox Transaction";
            ICPartner: Record "IC Partner";
            ICDataExchange: Interface "IC Data Exchange";
        begin
            ICInboxTrans.SetRange(Status, ICInboxTrans.Status::New);
            if AFilterTemplate <> '' then
                ICInboxTrans.SetRange("Source Template", AFilterTemplate);
            if AFilterBatch <> '' then
                ICInboxTrans.SetRange("Source Batch", AFilterBatch);
            if not ICInboxTrans.FindSet() then
                exit;
            repeat
                if ICPartner.Get(ICInboxTrans."Inbox Details") then begin
                    ICDataExchange := ICPartner."Data Exchange Type";
                    // call enqueue directly to force acceptance regardless of partner setting
                    ICDataExchange.EnqueueAutoAcceptedICInboxTransaction(ICPartner, ICInboxTrans);
                end;
            until ICInboxTrans.Next() = 0;
        end;
    }

    How to use:
    > Call this codeunit from a Job Queue entry that runs immediately after your IC Journal posting, or
    > Call it from your posting AL flow when the journal template/batch matches your one-off requirement.
     
    Notes:
    > Ensure the job runs with appropriate permissions.
    > Test for idempotency and duplicate enqueue handling in a sandbox.
    > This approach avoids changing Microsoft code and gives you per-template/batch control.
     
    Thanks
    Rishabh
  • Verified answer
    Aman Kakkar Profile Picture
    2,977 Super User 2026 Season 1 on at
    Thanks everyone for the valuable suggestions and guidance!

    I have summarized the whole process in a Blog Post along with code snippets that I used to enable "Auto. Send Transactions" and "Auto. Accept Transactions" in Intercompany (IC) transactions without relying on the standard setup booleans in Intercompany Setup.

    You can check the post here - 

    https://community.dynamics.com/blogs/post/?postid=7d566b6c-96a0-f011-b41c-000d3a1ccb00

     
  • Suggested answer
    Nimsara Jayathilaka. Profile Picture
    4,950 Super User 2026 Season 1 on at
    Hi
     
    codeunit 50100 "IC Auto Accept Override"
    {
        [EventSubscriber(ObjectType::Report, Report::"Move IC Trans. to Partner Comp", 'OnICInboxTransactionCreated', '', true, true)]
        local procedure OnICInboxTransactionCreatedOverride(var Sender: Report "Move IC Trans. to Partner Comp"; var ICInboxTransaction: Record "IC Inbox Transaction"; PartnerCompanyName: Text)
        var
            ICPartner: Record "IC Partner";
        begin
            ICPartner.SetRange("Inbox Details", PartnerCompanyName);
            if not ICPartner.FindFirst() then
                exit;
    
            if ShouldBypassAutoAccept(ICInboxTransaction, ICPartner) then begin
                exit;
            end;
        end;
    
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"IC Data Exchange", 'OnBeforeEnqueueAutoAcceptedICInboxTransaction', '', true, true)]
        local procedure OnBeforeEnqueueAutoAccepted(var ICPartner: Record "IC Partner"; var ICInboxTransaction: Record "IC Inbox Transaction"; var IsHandled: Boolean)
        begin
            if ShouldBypassAutoAccept(ICInboxTransaction, ICPartner) then begin
                IsHandled := true; // Prevent the auto-accept from happening
            end;
        end;
        local procedure ShouldBypassAutoAccept(ICInboxTransaction: Record "IC Inbox Transaction"; ICPartner: Record "IC Partner"): Boolean
        begin
            if ICPartner.Code = 'CRONUS' then
                exit(true);
    
            if ICInboxTransaction."Source Type" = ICInboxTransaction."Source Type"::"Journal Template" then
                exit(true);
    
            if ICInboxTransaction."Document Type" in [
                ICInboxTransaction."Document Type"::Invoice,
                ICInboxTransaction."Document Type"::"Credit Memo",
                ICInboxTransaction."Document Type"::Order] then
                exit(true);
    
            if ICInboxTransaction."Transaction Source" = ICInboxTransaction."Transaction Source"::"Created by Partner" then
                exit(true);
    
            if ICInboxTransaction."Transaction No." >= 1000 then // Example: high transaction numbers
                exit(true);
    
            exit(false);
        end;
    
        local procedure IsICInboxTransactionReturnedByPartner(TransactionSource: Enum "IC Transaction Source"): Boolean
        begin
            exit(TransactionSource = TransactionSource::"Returned by Partner");
        end;
    }
     
  • Aman Kakkar Profile Picture
    2,977 Super User 2026 Season 1 on at
     
    Thanks for taking the time to reply!

    This question already has verified answers, so additional responses aren’t really needed unless they bring new insights or corrections. Please make sure to check verified answers before posting.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,804 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,103 Super User 2026 Season 1

#3
Kamal Khakhkhar Profile Picture

Kamal Khakhkhar 695

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans