Hi, Readers.
Today I would like to talk about how to add a Factbox for lines/SubPage in Business Central.
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. Typically, you can use a FactBox to display information that is related to an item on the main content page. For example, on a page that shows a sales order, you can use a FactBox to show sell-to customer sales history for a selected sales order in the list as shown below.
In the base application:
I recently received a question, is it possible to add a Factbox for subpage instead of the main page? Such as for the Sales Order Subform (46, ListPart).
Yes, it’s actually not difficult, we just need to use Provider Property.
Provider Property: Sets the provider for a FactBox. This property enables you to create a link from a Repeater or any other type of control to a Factbox. It could also be used to link two FactBoxes.
Let’s assume a scenario: Adding Item Picture FactBox in Items Card to Sales Order Subform (46, ListPart).
Item Picture (346, CardPart)
For Example:
Test Video:
Very easy, give it a try!!!😁
Source Code:
pageextension 50111 ZYSalesOrderExt extends "Sales Order"
{
layout
{
addfirst(factboxes)
{
part(ItemPicture; "Item Picture")
{
ApplicationArea = All;
Caption = 'Picture';
Provider = SalesLines;
SubPageLink = "No." = FIELD("No.");
}
}
}
}
PS: In addition to the subpage, you can also refer to other FactBoxes on the page, but the new Factbox will have no data until the referenced FactBox is loaded.
Test Video:
- Parts can either represent self-contained functionality, or can be contextual and exchange information with the hosting page.
- A part can’t be hosted within another part. Business Central allows a maximum of one level of page nesting.
- Parts can’t be placed within repeater controls.
- Parts aren’t intended to be displayed on their own without a hosting page.
Find more about Adding a FactBox to a Page in MS Docs.
END
Hope this will help.
Thanks for reading.
ZHU
コメント