Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Public procedure] Query "Qty. Reserved From Item Ledger" - SetSourceFilter #27696

Open
fvet opened this issue Nov 26, 2024 · 0 comments
Open
Labels
request-for-external Request for exposing a function for extension development SCM GitHub request for SCM area

Comments

@fvet
Copy link
Contributor

fvet commented Nov 26, 2024

Describe the request

Can you please expose function SetSourceFilter in Query "Qty. Reserved From Item Ledger"?

Additional context

We want to calculate the ReservedQtyFromInventory for a given Sales / Purchase order by location, forcing us to copy the functions from codeunit 99000832 "Sales Line-Reserve" GetReservedQtyFromInventory.

Doing so fails to compile due to the missing access to SetSourceFilter.

internal procedure GetReservedQtyFromInventoryWithLocation(SalesHeader: Record "Sales Header"; LocationCode: Code[10]): Decimal
    var
        ReservationEntry: Record "Reservation Entry";
        QtyReservedFromItemLedger: Query "Qty. Reserved From Item Ledger";
    begin
        ReservationEntry.SetSource(Database::"Sales Line", SalesHeader."Document Type".AsInteger(), SalesHeader."No.", 0, '', 0);
        QtyReservedFromItemLedger.SetSourceFilter(ReservationEntry); // MISSING     
        QtyReservedFromItemLedger.SetFilter(Location_Code, LocationCode);
        QtyReservedFromItemLedger.Open();
        if QtyReservedFromItemLedger.Read() then
            exit(QtyReservedFromItemLedger.Quantity__Base_);

        exit(0);
    end;

Internal work item: AB#558855

@ChethanT ChethanT added request-for-external Request for exposing a function for extension development SCM GitHub request for SCM area labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request-for-external Request for exposing a function for extension development SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

2 participants