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

[Event Request] Codeunit 304 "No. Series - Impl." - OnNoSeriesLineFilterOnBeforeFindLast #26413

Closed
TNMers opened this issue May 3, 2024 · 2 comments
Labels
event-request Request for adding an event Integration GitHub request for Integration area

Comments

@TNMers
Copy link

TNMers commented May 3, 2024

Describe the request

Hello, could you please add an event in function GetNoSeriesLine with the handled-pattern:

[InherentPermissions(PermissionObjectType::TableData, Database::"No. Series Line", 'm')]
    procedure GetNoSeriesLine(var NoSeriesLine: Record "No. Series Line"; NoSeriesCode: Code[20]; UsageDate: Date; HideErrorsAndWarnings: Boolean): Boolean
    var
        NoSeriesRec: Record "No. Series";
        NoSeries: Codeunit "No. Series";
        NoSeriesErrorsImpl: Codeunit "No. Series - Errors Impl.";
#if not CLEAN24
#pragma warning disable AL0432
        NoSeriesManagement: Codeunit NoSeriesManagement;
#pragma warning restore AL0432
#endif
        LineFound: Boolean;
    begin
        if UsageDate = 0D then
            UsageDate := WorkDate();

        // Find the No. Series Line closest to the usage date
        NoSeriesLine.Reset();
        NoSeriesLine.SetCurrentKey("Series Code", "Starting Date");
        NoSeriesLine.SetRange("Series Code", NoSeriesCode);
        NoSeriesLine.SetRange("Starting Date", 0D, UsageDate);
        NoSeriesLine.SetRange(Open, true);
        if (NoSeriesLine."Line No." <> 0) and (NoSeriesLine."Series Code" = NoSeriesCode) then begin
            NoSeriesLine.SetRange("Line No.", NoSeriesLine."Line No.");
#if not CLEAN24
#pragma warning disable AL0432
            NoSeriesManagement.RaiseObsoleteOnNoSeriesLineFilterOnBeforeFindLast(NoSeriesLine);
#pragma warning restore AL0432
#endif
            LineFound := NoSeriesLine.FindLast();
            if not LineFound then
                NoSeriesLine.SetRange("Line No.");
        end;
#if not CLEAN24
#pragma warning disable AL0432
        if not LineFound then begin
            NoSeriesManagement.RaiseObsoleteOnNoSeriesLineFilterOnBeforeFindLast(NoSeriesLine);
            LineFound := NoSeriesLine.FindLast();
        end;
#pragma warning restore AL0432
#else
        if not LineFound then
            LineFound := NoSeriesLine.FindLast();
#endif

Event definition

[EventSubscriber(ObjectType::Codeunit, codeunit::NoSeriesManagement, 'OnNoSeriesLineFilterOnBeforeFindLast', '', false, false)]
    local procedure NoSeriesManagement_OnNoSeriesLineFilterOnBeforeFindLast(var NoSeriesLine: Record "No. Series Line")

Additional context

Compiler Warning AL0432
Internal work item: AB#538705

@darjoo darjoo added the event-request Request for adding an event label May 3, 2024
@pri-kise
Copy link
Contributor

Could you please outline why you need this event?

The IsHandled events where remove intentionally by @AndreasMoth in this PR microsoft/BCApps#319

There he asked for Feedback on this PR.
Further this object is now internal and the event would have to be add in the facade codeunit

@JesperSchulz JesperSchulz added event-request Request for adding an event Integration GitHub request for Integration area and removed event-request Request for adding an event labels Jun 18, 2024
@grobyns
Copy link
Contributor

grobyns commented Jun 26, 2024

This request is very similar to this one here: microsoft/BCApps#1362
For System Application and Business Foundation (and anything else already on BCApps) I'd recommend following the process there: Create an issue, when approved create a PR. Yes it's a little more work on your end but the lead time to a fix should be much shorter.

As this seems like a duplicate of the issue on BCApps i'll close this one.

@grobyns grobyns closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Integration GitHub request for Integration area
Projects
None yet
Development

No branches or pull requests

5 participants