Out of the box Business Central doesn’t allow to reserve items for Sales Quotes. But some business might require this and luckily its very easy thing to add.

First we need to create action to the Sales Quote Lines:

pageextension 50100 "Sales Quote Subform" extends "Sales Quote Subform"
{
    actions
    {
        addlast("F&unctions")
        {
            action(Reserve)
            {
                ApplicationArea = Reservation;
                Caption = '&Reserve';
                Ellipsis = true;
                Image = Reserve;
                Enabled = Rec.Type = Rec.Type::Item;
                ToolTip = 'Reserve the quantity of the selected item that is required on the document line from which you opened this page. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    Rec.Find();
                    Rec.ShowReservation();
                end;
            }
        }
    }
}

And then we also need this event subscriber. Otherwise we will get error when we try to create the Reservation.

codeunit 50100 "Subscribers"
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Create Reserv. Entry", 'OnAfterCheckSourceTypeSubtype', '', false, false)]
    local procedure AllowSalesQuoteToBeReserved(var ReservationEntry: Record "Reservation Entry"; var IsError: Boolean)
    begin
        if ReservationEntry."Source Type" = Database::"Sales Line" then begin
            if ReservationEntry."Source Subtype" = 0 then
                IsError := false;
        end;
    end;
}

And thats it actually. Now I can create reservations for Sales Quotes and when I convert the Sales Quote to Sales Order the reservation is automatically transfered and changed to Sales Order reservation.


Leave a Reply

Your email address will not be published. Required fields are marked *