Hi, Readers.
Today I would like to talk about how to display Work Description in FactBox.
Work Description field is a BLOB Data Type field, which usually contain multiline text. For example, on the Sales Order page:
table 36 “Sales Header”:
PS:
1. Business Central 2024 wave 1 (BC24): Export, import multiline text with Configuration Packages (Use BLOB type fields in Configuration Packages)
2. Dynamics 365 Business Central: How to export Work Description (Blob) in Sales Documents to excel
There is a small problem here. The value of this field can only be seen when opening the Sales Order (42, Document) page, not on the Sales Order List (9305, List) page.
So, is it possible to display it in a FactBox?
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 list, you can use a FactBox to show sell-to customer sales history for a selected sales order in the list as shown below. More details: Adding a FactBox to a Page
PS: I want to mention why users can’t use the Notes feature instead. There are mainly two reasons. First, in the Notes FactBox, a link containing partial text will be displayed, which cannot display all the content. Users must click it to display all the content.
Second, Notes cannot be printed directly in a standard report, but Work Description can.
This can be done, but it requires customization. It’s not difficult, and in simple terms it only takes two steps.
1. Create a FactBox to display the Word Description.
2. Add it to the page where it needs to be displayed, such as Sales Order List (9305, List) page.
Done.
Test video:
Very simple, give it a try!!!😁
Source code: Github (Please note that the source code is for reference only, you can improve it according to your own needs)
pageextension 50222 SalesOrderListExt extends "Sales Order List"
{
layout
{
addbefore(Control1902018507)
{
part(salesOrderWorkDescription; "Sales Order Work Description")
{
ApplicationArea = All;
SubPageLink = "No." = field("No."),
"Document Type" = field("Document Type");
}
}
}
}
page 50222 "Sales Order Work Description"
{
Caption = 'Work Description';
DeleteAllowed = false;
InsertAllowed = false;
LinksAllowed = false;
PageType = CardPart;
SourceTable = "Sales Header";
layout
{
area(content)
{
field(WorkDescription; WorkDescription)
{
ApplicationArea = All;
Importance = Additional;
MultiLine = true;
ShowCaption = false;
}
}
}
var
WorkDescription: Text;
trigger OnAfterGetRecord()
begin
WorkDescription := '';
if Rec."Work Description".HasValue then
WorkDescription := Rec.GetWorkDescription();
end;
}
PS: FactBox Performance considerations
Having a page composed of multiple FactBox pages that each process data from different sources can degrade performance. To improve responsiveness and the time it takes to load the page, Business Central 2020 release wave 2 and later optimizes the sequence in which content is loaded. The sequence is as follows:
- Content on the hosting page is loaded first, and users can immediately begin interacting with it.
- The FactBox pane is loaded next, where each FactBox is loaded independently in sequence starting from the top.
- FactBoxes having the
Visible
property evaluate tofalse
won’t be loaded. - FactBoxes that aren’t within view are only loaded when the user scrolls them into view. If the FactBox pane is collapsed, no FactBoxes are loaded until the user expands the FactBox pane.
- FactBoxes having the
END
Hope this will help.
Thanks for reading.
ZHU
コメント