Skip to main content

Freeze integration into custom pages

Overview

The DEXPRO Freeze extension provides document archiving functionality that lets users store and retrieve documents, attachments, and related data for any Business Central record. This guide explains how to integrate the Freeze functionality into custom pages.

Core components

1. Quick Freeze infobox

The central component is the "DXP FRZ Quick Freeze FB" page, which provides the following:

  • Drag-and-drop file upload functionality
  • Display of archived records related to the current record
  • Quick access to Freeze operations

2. Management codeunits

  • "DXP Extension Mgt." - Manages Freeze queue operations and background processing.
  • "DXP Freeze Search Mgt." - Manages search functionality for archived records.
  • "DXP FRZ Result Mgt." - Manages result display and archive viewing.

3. Key tables

  • "DXP Frz Recent Record" - Stores recent Freeze entries.
  • "DXP Freeze Setup" - Configuration settings.
  • "DXP Freeze Record Type" - Available record types for archiving.

Implementation steps

Step 1: Add the infobox

Add the Quick Freeze infobox to the layout area of your page:

layout
{
    addfirst(factboxes)
    {
        part("DXP Quick Archive"; "DXP FRZ Quick Freeze FB")
        {
            ApplicationArea = All;
            SubPageLink = "Record System ID" = field(SystemId),
                         "Record Table No." = const(Database::"Your Table Name");
            SubPageView = sorting("Entry No.") order(descending);
        }
    }
}

Important notes:

  • Replace Database::"Your Table Name" with the appropriate table constant.

Step 2: Add navigation actions

actions
{
    addfirst(navigation)
    {
        action("DXP Freeze")
        {
            Caption = 'Open Freeze';
            ApplicationArea = All;
            Image = Archive;
            ToolTip = 'Opens the Freeze archive and shows attachments linked to the selected record.';
            ShortcutKey = 'Ctrl+Alt+F';
            trigger OnAction()
            var
                ResultMgt: Codeunit "DXP FRZ Result Mgt.";
            begin
                ResultMgt.SubmitSearchAndShowResults(Rec.RecordId(), FrzSearchMgt.GetSearchCombinationForTable(Rec.SystemId, Rec.RecordId.TableNo()));
            end;
        }
    }
}

Step 3: Add promoted actions

actions
{
    addfirst(Category_Category16)
    {
        actionref("DXP Freeze_Promoted"; "DXP Freeze")
        {
        }
    }
    modify(Category_Category16)
    {
        Caption = 'DEXPRO Freeze', Locked = true;
    }
}

Step 4: Add the page trigger

trigger OnAfterGetCurrRecord()
begin
    CurrPage."DXP Quick Archive".Page.SetSourceRecord(Rec.RecordId());
end;

Step 5: Declare the variables

var
    ExtMgt: Codeunit "DXP Extension Mgt.";
    FrzSearchMgt: Codeunit "DXP Freeze Search Mgt.";

Complete example

Here is a complete example for a custom document page:

pageextension 50000 "My Custom Doc. Ext." extends "My Custom Document"
{
    layout
    {
        addfirst(factboxes)
        {
            part("DXP Quick Archive"; "DXP FRZ Quick Freeze FB")
            {
                ApplicationArea = All;
                SubPageLink = "Record System ID" = field(SystemId),
                         "Record Table No." = const(Database::"Your Table Name");
                SubPageView = sorting("Entry No.") order(descending);
            }
        }
    }

    actions
    {
        addfirst(navigation)
        {
            action("DXP Freeze")
            {
                Caption = 'Open Freeze';
                ApplicationArea = All;
                Image = Archive;
                ToolTip = 'Opens the Freeze archive and shows attachments linked to the selected record.';
                ShortcutKey = 'Ctrl+Alt+F';
                trigger OnAction()
                var
                    ResultMgt: Codeunit "DXP FRZ Result Mgt.";
                begin
                    ResultMgt.SubmitSearchAndShowResults(Rec.RecordId(), FrzSearchMgt.GetSearchCombinationForTable(Rec.SystemId, Rec.RecordId.TableNo()));
                end;
            }
        }

        addfirst(Category_Category16)
        {
            actionref("DXP Freeze_Promoted"; "DXP Freeze")
            {
            }
        }
        modify(Category_Category16)
        {
            Caption = 'DEXPRO Freeze', Locked = true;
        }
    }

    trigger OnAfterGetCurrRecord()
    begin
        CurrPage."DXP Quick Archive".Page.SetSourceRecord(Rec.RecordId());
    end;

    var
        ExtMgt: Codeunit "DXP Extension Mgt.";
        FrzSearchMgt: Codeunit "DXP Freeze Search Mgt.";
}

Setting up additional search queries

To also display archive entries based on records that are not directly linked via the system ID / table number (archived via BC), you can set up additional search queries. This is documented here: https://docs.squeeze.one/books/freeze-for-dynamics-365-bc-de-de/page/zusatzliche-suchabfragen

Testing your implementation

  1. Navigate to your extended page.
  2. Verify that the Quick Freeze infobox appears.
  3. Test the "Open Freeze" action (Ctrl+Alt+F).
  4. Upload test files by drag-and-drop.
  5. Verify that archived records appear in the infobox.

This integration pattern ensures consistent Freeze functionality across all Business Central pages while preserving the user experience established by the DEXPRO Freeze extension.