microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
773 stars 610 forks source link

Change SetCalledBy from internal to public #26733

Closed MaxFalcone closed 3 months ago

MaxFalcone commented 3 months ago

Describe the request

Description: There are fuctions called SetCalledBy in codeunits 80 "Sales-Post" and 90 "Purch.-Post". They serve the same purpose but in "Sales-Post" this function is public and in "Purch.-Post" the same function is internal.

Requested change:

In codeunit 90 "Purch.-Post"

Before change

    internal procedure SetCalledBy(NewCalledBy: Integer)
    begin
        CalledBy := NewCalledBy;
    end;

After cahnge

    procedure SetCalledBy(NewCalledBy: Integer)
    begin
        CalledBy := NewCalledBy;
    end;

Additional context

This function allows to call one posting routine from another and allows subroutine not to throw error in the preview mode. Error will be thrown by the owning posting routine.

We need this change because we have a specific requirement from our customer to post addidtional corrective documents when application of Vendor Ledger Entries occures. Hence we call Purch.-Post from the function subscribed to codeunit 12 "Gen. Jnl.-Post Line". This works perfectly well for Sales Posting where SetCalledBy is public. Internal work item: AB#539362

JesperSchulz commented 3 months ago

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 21453.