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