Dynamics 365 Business Central: How to add Dimensions FactBox on the pages

Dynamics 365 Business Central

Hi, Readers.
I was asked last week whether dimensions can be displayed in the FactBox for easy viewing on the page. For example, on Customer, Vendor, Item, Sales order, Item Journal, and so on.
So, in this post, I would like to talk about how to do it.

As you might know, dimensions are a great tool available in Microsoft Dynamics Business Central which makes it easy to organize and analyze data. Dimensions are values that categorize entries so you can track and analyze them on documents, such as sales orders. Dimensions can, for example, indicate the project or department an entry came from.

Note: Not all data in Business Central has dimensions.

And a FactBox is the area that is located on the right-most side of a page and it is divided into one or more parts that are arranged vertically. This area is used to display content including other pages, charts, and system parts such as Notes, and Links.

In fact, Microsoft has added the Dimensions FactBox on some pages.
For example,
Masters: Customer Card

Other journals or documents: General Journals

We can simply refer to the standard code to do this. But it should be noted that the logic of master data and other journals or documents are different and cannot be used interchangeably.

Let’s see some source code in Base Application. (sandbox/18.1.24822.25909/jp)

Customer Card:

page 9083 “Dimensions FactBox”

table 352 “Default Dimension”: You can assign a default dimension for a specific account. The dimension will be copied to the journal or document when you enter the account number on a line, but you can delete or change the code on the line if appropriate.

General Journal:

page 699 “Dimension Set Entries FactBox”:

table 480 “Dimension Set Entry”: A dimension set is a unique combination of dimension values. It is stored as dimension set entries in the database. Each dimension set entry represents a single dimension value. The dimension set is identified by a common dimension set ID that is assigned to each dimension set entry that belongs to the dimension set.

So if you want to add this feature to the masters, please refer to the first method, such as Item, Vendor, G/L Account, and if you want to add this feature to other journals or documents, please refer to the second method, such as Sales Order, Item Journal, etc.

For easy understanding, next let’s look at a few examples.

1. Add Dimensions FactBox to Item Card: The only thing to note is to change the Table ID.

pageextension 50100 "Item Card DimFactBox Ext" extends "Item Card"
{
    layout
    {
        addfirst(factboxes)
        {
            part(DimensionsFactBox; "Dimensions FactBox")
            {
                ApplicationArea = Basic, Suite;
                SubPageLink = "Table ID" = CONST(27),
                              "No." = FIELD("No.");
            }
        }
    }
}

2. Add Dimensions FactBox to Item List: Table is the same, so is the code.

Test Video:

3. Add Dimensions FactBox to Sales Order.

pageextension 50102 "Sales Order DimFactBox Ext" extends "Sales Order"
{
    layout
    {
        addfirst(factboxes)
        {
            part(DimensionSetEntriesFactBox; "Dimension Set Entries FactBox")
            {
                ApplicationArea = Basic, Suite;
                SubPageLink = "Dimension Set ID" = FIELD("Dimension Set ID");
            }
        }
    }
}

4. Add Dimensions FactBox to Item Journal.

Test Video:

Isn’t it easy? Give it a try.

END

Hope this will help.

Thanks for reading.

ZHU

コメント

タイトルとURLをコピーしました