How can we add the Document Archive FactBoxes to other pages?

You can add the Document Archive factboxes to other/your own pages.

View the Code Sample to see how you can add the factboxes to the "Assembly Order" page.

Code Sample

Document Archive FactBoxes Code Sample

How to add Document Archive factboxes on pages.

Document Archive offers two types of factboxes:

  • FactBox showing the available categories and the number of files attached for each category for the (selected) record.
  • FactBox showing the individual files attached for the (selected) record.

You can add these factboxes and need to properly set up the SubPageLink property to specify the table and primary key link for the records that are shown on the page to which you are adding the factboxes.


pageextension 70257130 WSB_AssemblyOrderDCA extends "Assembly Order"
{
layout
{
addfirst(Factboxes)
{
part(WSB_DCACategoryFactBox; WSB_DCACategoryFactBox)
{
ApplicationArea = All;
Enabled = WSB_DCACategoryFactBoxVisible;
#pragma warning disable AL0603
SubPageLink = TableNoFilter = const(Database::"Assembly Header"), SourceTypeFilter = field("Document Type"), SourceNoFilter = field("No.");
#pragma warning restore AL0603
Visible = WSB_DCACategoryFactBoxVisible;
}
part(WSB_DCAFileFactBox; WSB_DCAFileFactBox)
{
ApplicationArea = All;
Enabled = WSB_DCAFileFactBoxVisible;
#pragma warning disable AL0603
SubPageLink = TableNo = const(Database::"Assembly Header"), SourceType = field("Document Type"), SourceNo = field("No.");
#pragma warning restore AL0603
Visible = WSB_DCAFileFactBoxVisible;
}
}
}
var
WSB_DCACategoryFactBoxVisible: Boolean;
WSB_DCAFileFactBoxVisible: Boolean;

trigger OnAfterGetCurrRecord()
begin
CurrPage.WSB_DCACategoryFactBox.Page.wgFncSetRecordId(Rec.RecordId());
CurrPage.WSB_DCAFileFactBox.Page.wgFncSetRecordId(Rec.RecordId());
end;
trigger OnOpenPage()
begin
WSB_DCACategoryFactBoxVisible := CurrPage.WSB_DCACategoryFactBox.Page.wgFncShowFactBox();
WSB_DCAFileFactBoxVisible := CurrPage.WSB_DCAFileFactBox.Page.wgFncShowFactBox();
end;
}