BCApps icon indicating copy to clipboard operation
BCApps copied to clipboard

codeunit 8063 "Sales Documents" procedure CreateServiceObjectFromSales

Open samra-singhammer opened this issue 1 year ago • 8 comments

Why do you need this change?

We need more flexibility in the CreateServiceObjectFromSales procedure in order to handle when is service object created.

Describe the request

Can you please considere extending it like below:

[IntegrationEvent(false, false)]
    local procedure OnBeforeCreateServiceObjectFromSales(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; SalesShptLine: Record "Sales Shipment Line"; var CanCreateServiceObject: Boolean)
    begin
    end;

    procedure CreateServiceObjectFromSales(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var SalesShptLine: Record "Sales Shipment Line")
    var
        TempTrackingSpecBuffer: Record "Tracking Specification" temporary;
        ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
        CanCreateServiceObject: Boolean;
    begin
        //The function creates Subscription for Sales Line with Subscription Lines
        CanCreateServiceObject := SalesServiceCommMgmt.IsSalesLineWithSalesServiceCommitmentsToShip(SalesLine, SalesShptLine.Quantity);
        OnBeforeCreateServiceObjectFromSales(SalesHeader, SalesLine, SalesShptLine, CanCreateServiceObject);

        if CanCreateServiceObject then begin
            ItemTrackingDocMgt.RetrieveDocumentItemTracking(TempTrackingSpecBuffer, SalesShptLine."Document No.", Database::"Sales Shipment Header", 0);
            TempTrackingSpecBuffer.SetRange("Source Ref. No.", SalesShptLine."Line No.");
            if not TempTrackingSpecBuffer.IsEmpty() then
                CreateServiceObjectFromTrackingSpecification(SalesHeader, SalesLine, TempTrackingSpecBuffer)
            else
                CreateServiceObjectFromSalesLine(SalesHeader, SalesLine);
        end;
    end;

Internal work item: AB#598047

samra-singhammer avatar Aug 20 '25 10:08 samra-singhammer

The subscription billing app is now part of the BCApps repository. Shouldn't event requests be created at the the BCApps repository now? @JesperSchulz

pri-kise avatar Aug 25 '25 09:08 pri-kise

The subscription billing app is now part of the BCApps repository. Shouldn't event requests be created at the the BCApps repository now? @JesperSchulz

Indeed! I will transfer this issue. Also, with the code being on BCApps, partners should implement the code themselves through a pull request.

JesperSchulz avatar Aug 26 '25 09:08 JesperSchulz

@samra-singhammer, could you create pull request here on BCApps which addresses your request?

JesperSchulz avatar Sep 03 '25 07:09 JesperSchulz

@JesperSchulz Yes. Thanks you.

samra-singhammer avatar Sep 04 '25 07:09 samra-singhammer

@samra-singhammer, what's the status on this one?

JesperSchulz avatar Feb 10 '26 13:02 JesperSchulz

@JesperSchulz @samra-singhammer @AndersLarsenMicrosoft @miljance Should we close this case?

djukicmilica avatar Apr 01 '26 09:04 djukicmilica

@samra-singhammer This function has been obsoleted. In best case the new approach has to be proposed. Until then I guess you do not need this Event any longer? Can this Issue be closed?

miljance avatar Apr 01 '26 09:04 miljance

closed

AndersLarsenMicrosoft avatar May 13 '26 06:05 AndersLarsenMicrosoft