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;