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] table 7005 "Price Source" - OnAfterFilterPriceLines #27809

Open
PetroKharchenko opened this issue Dec 13, 2024 · 0 comments
Open
Labels
event-request Request for adding an event SCM GitHub request for SCM area

Comments

@PetroKharchenko
Copy link

PetroKharchenko commented Dec 13, 2024

Describe the request

Please implement an event in table 7005, "Price Source", to apply additional filtering logic after the initial filters on Price Source have been applied:

  1. Add a publisher method: OnAfterFilterPriceLines.
  2. Modify the procedure FilterPriceLines to include a call to the added publisher method.

Code example:

table 7005 "Price Source"
{

...

    procedure FilterPriceLines(var PriceListLine: Record "Price List Line") Result: Boolean;
    begin
        PriceListLine.SetRange("Source Type", "Source Type");
        if IsSourceNoAllowed() then begin
            if "Source No." = '' then
                exit;

            PriceListLine.SetRange("Source No.", "Source No.");
            if "Parent Source No." <> '' then
                PriceListLine.SetRange("Parent Source No.", "Parent Source No.");
        end else
            PriceListLine.SetRange("Source No.");
        // requested change >>
        OnAfterFilterPriceLines(Rec, PriceListLine);
        // requested change <<
    end;

...

    // requested change >>
    [IntegrationEvent(false, false)]
    local procedure OnAfterFilterPriceLines(PriceSource: Record "Price Source"; var PriceListLine: Record "Price List Line")
    begin
    end;
    // requested change <<
	
}

Additional context

The Price Lists functionality is quite extensible from the side of Price Asset, but has limited extensibility from the side of Price Sources. For instance, the filtering of Price List Line records on Price Asset is implemented as a method in the Price Asset interface, allowing customizations by adding custom implementations of this interface. On the other hand, filtering of Price List Line records on Price Source is implemented directly in the table 7005 "Price Source" in a non-extensible way.
Technically, Price Sources can be also extended, but currently it is not possible to apply filters based on additional fields in the Price Source table. To implement this filtering, it should be sufficient to have an event triggered after the filters on Price Source are applied in the FilterPriceLines procedure in table 7005, "Price Source".
Internal work item: AB#560628

@JesperSchulz JesperSchulz added event-request Request for adding an event SCM GitHub request for SCM area labels Dec 14, 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 SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

2 participants