| Docs Help
  AppSource  
Docs  /  NAVAX G/L Application  /  Appendix

 Information for Developers


2024/09/28 • 2 min. to read

Additional Journals

By default, the NAVAX G/L Application is already integrated into some journals via pageextensions. The code is identical in all journals. Thus, the NAVAX G/L Application can also be made available in other journals with little effort via individual programming. Below is the code for the integration using the General Journal as an example.
pageextension 70714681 "NVXGLA General Journal" extends "General Journal"
{
    ContextSensitiveHelpPage = 'Journal';

    layout
    {
        modify("Account Type")
        {
            trigger OnAfterValidate();
            begin
                NVXGLAEnableApplyGLEntriesAction();
            end;
        }
        modify("Bal. Account Type")
        {
            trigger OnAfterValidate();
            begin
                NVXGLAEnableApplyGLEntriesAction();
            end;
        }
        addafter("Applies-to ID")
        {
            field("NVXGLA Applies-to Doc. Type"; Rec."NVXGLA Applies-to Doc. Type")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the type of the posted document that this document or journal line will be applied to when you post.';
                Visible = false;
            }
            field("NVXGLA Applies-to Doc. No."; Rec."NVXGLA Applies-to Doc. No.")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the number of the posted document that this document or journal line will be applied to when you post.';
                Visible = false;
            }
            field("NVXGLA Applies-to ID"; Rec."NVXGLA Applies-to ID")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the ID of entries that will be applied to when you choose the ''GLA Apply G/L Entries'' action.';
                Visible = false;
            }
        }
    }

    actions
    {
        addafter("Apply Entries")
        {
            action(NVXGLAApplyEntriesAction)
            {
                ApplicationArea = All;
                Caption = 'GLA Apply G/L Entries';
                Ellipsis = true;
                Enabled = NVXGLAApplyGLEntriesActionEnabled;
                Image = ApplyEntries;
                RunObject = Codeunit "NVXGLA Gen. Jnl.-Apply";
                ShortCutKey = 'Alt+F11';
                ToolTip = 'Apply the amount on a journal line to one or multiple G/L Entries.';
            }
        }
        addafter("Apply Entries_Promoted")
        {
            actionref(NVXGLAApplyEntriesAction_Promoted; NVXGLAApplyEntriesAction)
            {
            }
        }
    }

    var
        NVXGLAApplyGLEntriesActionEnabled: Boolean;

    trigger OnAfterGetRecord()
    begin
        NVXGLAEnableApplyGLEntriesAction();
    end;

    trigger OnAfterGetCurrRecord();
    begin
        NVXGLAEnableApplyGLEntriesAction();
    end;

    trigger OnNewRecord(BelowxRec: Boolean);
    begin
        NVXGLAEnableApplyGLEntriesAction();
    end;

    local procedure NVXGLAEnableApplyGLEntriesAction()
    begin
        NVXGLAApplyGLEntriesActionEnabled :=
            (Rec."Account Type" = Rec."Account Type"::"G/L Account") or
            (Rec."Bal. Account Type" = Rec."Bal. Account Type"::"G/L Account");
    end;
}


Submit feedback for
DE|EN Imprint