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] Report 81 "Import Budget from Excel".OnPreDataItem #27899

Open
fridrichovsky opened this issue Jan 8, 2025 · 0 comments
Open

Comments

@fridrichovsky
Copy link
Contributor

Describe the request

Please add new parameter to event

trigger OnPreDataItem()
var
    ConfirmManagement: Codeunit "Confirm Management";
    IsHandled: Boolean;
begin
    RecNo := 0;

    if not GLBudgetName.Get(ToGLBudgetName) then begin
        if not ConfirmManagement.GetResponseOrDefault(
                StrSubstNo(Text001, GLBudgetName.TableCaption(), ToGLBudgetName), true)
        then
            CurrReport.Break();
        GLBudgetName.Name := ToGLBudgetName;
        GLBudgetName.Insert();
    end else begin
        IsHandled := false;
        OnBeforeCheckGLBudgetNameBlacked(GLBudgetName, IsHandled);
        if not IsHandled then
            if GLBudgetName.Blocked then begin
                Message(Text002, GLBudgetEntry.FieldCaption("Budget Name"), ToGLBudgetName);
                CurrReport.Break();
            end;
        if not ConfirmManagement.GetResponseOrDefault(
                StrSubstNo(Text003, LowerCase(Format(SelectStr(ImportOption + 1, Text027))), ToGLBudgetName), true)
        then
            CurrReport.Break();
    end;

    IsHandled := false;
    //------------------------------------------------------------OnBeforeGetLastEntryNoBeforeImport:BEGIN
    //OnBeforeGetLastEntryNoBeforeImport(GLBudgetEntry3, LastEntryNoBeforeImport, IsHandled);
    OnBeforeGetLastEntryNoBeforeImport(GLBudgetEntry3, LastEntryNoBeforeImport, IsHandled, EntryNo);
    //------------------------------------------------------------OnBeforeGetLastEntryNoBeforeImport:END
    if not IsHandled then begin
        GLBudgetEntry3.LockTable();
        LastEntryNoBeforeImport := GLBudgetEntry3.GetLastEntryNo();
        EntryNo := LastEntryNoBeforeImport + 1;
    end;
end;

//------------------------------------------------------------OnBeforeGetLastEntryNoBeforeImport:BEGIN
[IntegrationEvent(false, false)]
//local procedure OnBeforeGetLastEntryNoBeforeImport(var GLBudgetEntry3: Record "G/L Budget Entry"; var LastEntryNoBeforeImport: Integer; var IsHandled: Boolean)
local procedure OnBeforeGetLastEntryNoBeforeImport(var GLBudgetEntry3: Record "G/L Budget Entry"; var LastEntryNoBeforeImport: Integer; var IsHandled: Boolean, var EntryNo: Integer)
begin
end;
//------------------------------------------------------------OnBeforeGetLastEntryNoBeforeImport:END

Additional context

If we can skip EntryNo generation we need option how to set it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant