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 99000756 VersionManagement.GetBOMVersion #27703

Open
fridrichovsky opened this issue Nov 26, 2024 · 0 comments
Open
Labels
event-request Request for adding an event SCM GitHub request for SCM area

Comments

@fridrichovsky
Copy link
Contributor

fridrichovsky commented Nov 26, 2024

Describe the request

Please add new event

    procedure GetBOMVersion(BOMHeaderNo: Code[20]; Date: Date; OnlyCertified: Boolean) VersionCode: Code[20]
    var
        ProdBOMVersion: Record "Production BOM Version";
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeGetBOMVersion(BOMHeaderNo, Date, OnlyCertified, VersionCode, IsHandled);
        if IsHandled then
            exit(VersionCode);

        ProdBOMVersion.SetCurrentKey("Production BOM No.", "Starting Date");
        ProdBOMVersion.SetRange("Production BOM No.", BOMHeaderNo);
        ProdBOMVersion.SetFilter("Starting Date", '%1|..%2', 0D, Date);
        if OnlyCertified then
            ProdBOMVersion.SetRange(Status, ProdBOMVersion.Status::Certified)
        else
            ProdBOMVersion.SetFilter(Status, '<>%1', ProdBOMVersion.Status::Closed);
        //----------------------------------------OnGetBOMVersionOnBeforeProdBOMVersionFindLast:BEGIN
        OnGetBOMVersionOnBeforeProdBOMVersionFindLast(ProdBOMVersion, BOMHeaderNo, Date, OnlyCertified);
        //----------------------------------------OnGetBOMVersionOnBeforeProdBOMVersionFindLast:END
        if not ProdBOMVersion.FindLast() then
            Clear(ProdBOMVersion);

        exit(ProdBOMVersion."Version Code");
    end;

    //----------------------------------------OnGetBOMVersionOnBeforeProdBOMVersionFindLast:BEGIN
    local procedure OnGetBOMVersionOnBeforeProdBOMVersionFindLast(var ProdBOMVersion: Record "Production BOM Version"; BOMHeaderNo: Code[20]; Date: Date; OnlyCertified: Boolean)
    begin
    end;
    //----------------------------------------OnGetBOMVersionOnBeforeProdBOMVersionFindLast:END

Additional context

we need change filters for ProdBOMVersion.
Internal work item: AB#558860

@ChethanT ChethanT added event-request Request for adding an event SCM GitHub request for SCM area labels Nov 27, 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