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

New event Codeunit 432 Consolidate #28174

Open
camadorsummar opened this issue Feb 18, 2025 · 0 comments
Open

New event Codeunit 432 Consolidate #28174

camadorsummar opened this issue Feb 18, 2025 · 0 comments

Comments

@camadorsummar
Copy link

camadorsummar commented Feb 18, 2025

Describe the request

 local procedure TestGLAccounts()
    var
        AccountToTest: Record "G/L Account";
    begin
        // First test within the Subsidiary Chart of Accounts
        AccountToTest := TempSubsidGLAcc;
        if AccountToTest.TranslationMethodConflict(TempSubsidGLAcc) then begin
            if TempSubsidGLAcc.GetFilter("Consol. Debit Acc.") <> '' then
                ReportError(
                  StrSubstNo(
                    Text021,
                    TempSubsidGLAcc."No.",
                    TempSubsidGLAcc.FieldCaption("Consol. Debit Acc."),
                    TempSubsidGLAcc.FieldCaption("Consol. Translation Method"),
                    AccountToTest."No.", BusUnit.TableCaption()))
            else
                ReportError(
                  StrSubstNo(Text021,
                    TempSubsidGLAcc."No.",
                    TempSubsidGLAcc.FieldCaption("Consol. Credit Acc."),
                    TempSubsidGLAcc.FieldCaption("Consol. Translation Method"),
                    AccountToTest."No.", BusUnit.TableCaption()));
        end else begin
            TempSubsidGLAcc.Reset();
            TempSubsidGLAcc := AccountToTest;
            TempSubsidGLAcc.Find('=');
        end;
        // NEW
        // OnBeforeTestForConflictsTestGLAccounts(TempSubsidGLAcc);
        // 
        // Then, test for conflicts between subsidiary and parent (consolidated)
        if TempSubsidGLAcc."Consol. Debit Acc." <> '' then begin
            if not ConsolidGLAcc.Get(TempSubsidGLAcc."Consol. Debit Acc.") then
                ReportError(
                  StrSubstNo(Text022,
                    TempSubsidGLAcc.FieldCaption("Consol. Debit Acc."), TempSubsidGLAcc."Consol. Debit Acc.",
                    TempSubsidGLAcc.TableCaption(), TempSubsidGLAcc."No.", BusUnit.TableCaption()));
            if (TempSubsidGLAcc."Consol. Translation Method" <> ConsolidGLAcc."Consol. Translation Method") and
               (BusUnit."File Format" <> BusUnit."File Format"::"Version 3.70 or Earlier (.txt)")
            then
                ReportError(
                  StrSubstNo(Text023,
                    TempSubsidGLAcc.TableCaption(), TempSubsidGLAcc."No.",
                    TempSubsidGLAcc.FieldCaption("Consol. Translation Method"), ConsolidGLAcc."No.",
                    TempSubsidGLAcc."Consol. Translation Method", ConsolidGLAcc."Consol. Translation Method",
                    BusUnit.TableCaption()));
        end;


  [IntegrationEvent(true, false)]
    local procedure OnBeforeTestForConflictsTestGLAccounts(TempSubsidGLAcc: Record "G/L Account" temporary)
    begin
    end;

Additional context

To be able to control or create accounts according to customer's request.

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