ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Bug]: Subscription BillingApp - wrong IsHandled Pattern

Open sweikelt opened this issue 1 year ago • 4 comments

Describe the issue

in the codeunit "Sales Documents a wrong pattern for isHandled is used

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnPostSalesLineOnBeforeInsertInvoiceLine, '', false, false)]
    local procedure SkipInsertingSalesInvoiceLineIfServiceCommitmentItemsExist(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var IsHandled: Boolean)
    var
        ParentSalesLine: Record "Sales Line";
    begin
        //The function skips inserting Sales Invoice Lines in two cases:
        //When a SalesLine is a Subscription Item
        //When a SalesLine is attached to a Subscription Item (Extended Text)
        IsHandled := SalesLineShouldSkipInvoicing(SalesLine);
        if (SalesLine.Type = SalesLine.Type::" ") and (SalesLine."Attached to Line No." <> 0) then
            if ParentSalesLine.Get(SalesLine."Document Type", SalesLine."Document No.", SalesLine."Attached to Line No.") then
                IsHandled := SalesLineShouldSkipInvoicing(ParentSalesLine);
        OnAfterSkipInsertingSalesInvoiceLineIfServiceCommitmentItemsExist(SalesHeader, SalesLine, IsHandled);
    end;

isHandled will be set to false, even if it was set to true by another app

Expected behavior

correct behavior

Steps to reproduce

build an app "MyOwnApp" with an subscriber like that [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnPostSalesLineOnBeforeInsertInvoiceLine', '', true, false)] local procedure OnBeforeInsertInvoiceLine(SalesLine: Record "Sales Line"; var IsHandled: Boolean) begin IsHandled := SalesLine."SplitSalesLine"; end;

install the "Subscription Billing" App after MyOwnApp

Additional context

No response

I will provide a fix for a bug

  • [x] I will provide a fix for a bug

sweikelt avatar Jun 23 '25 14:06 sweikelt

This is the wrong repository for reporting problems with the First Party App "Subscription Billing".

If you do not intend to fix this bug by yourself and you require a fix then you have to create a support request via the normal process.

If you made a wrong selection and instead want to provide a bugfix then this issue can be moved by someone of microsoft to the repository https://github.com/microsoft/ALAppExtensions .

There you then can provide a bugfix via a pull request.

pri-kise avatar Jun 23 '25 15:06 pri-kise

hey @pri-kise , thnx for the response. i think i can provide a bugfix via pr, so a move to the correct repo by some1 from ms would be nice

sweikelt avatar Jun 23 '25 15:06 sweikelt

This issue has been approved for contribution ✅ Thanks for contributing.

github-actions[bot] avatar Jun 24 '25 08:06 github-actions[bot]

You're good to go! We'll be expecting a PR 😊

JesperSchulz avatar Jun 24 '25 08:06 JesperSchulz