[Bug]: Subscription BillingApp - wrong IsHandled Pattern
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
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.
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
This issue has been approved for contribution ✅ Thanks for contributing.
You're good to go! We'll be expecting a PR 😊