Hi, Readers.
Last week we briefly discussed how to add Notes (System Parts) from FactBox to a report.
Later I received some feedback that it might be better to use the Comments feature instead of Notes. For example,
As you might know, you can add extra information to G/L accounts, customers cards, or sales orders to communicate exceptions or special agreements to other users. Practically all cards and document have a Comments action, which opens the Comment Sheet page where you can write or read comments.
On documents, you can also add comments to individual lines.
Comments on ongoing documents are transferred to the related posted document. For example, a comment on a sales order is transferred to a resulting posted sales shipment. In addition, you can specify if you want comments to be transferred from one type of document to another resulting type of document, such as from a sales order to a sales invoice. You do this in the Sales & Receivables and the Purchases & Payables pages respectively.
PS: The Comment field has a length limit of 80 characters, Comment (6, Text[80]).
Yes, this method is also suitable for recording extra information. However, minor customization is still required to display it on a page or within a report. So in this post, I’ll be using Sales Orders as an example to share some quick insights.
Adding comments to Factbox
First, add a ListPart page to display the comments.
Then add it to the Sales Order page.
Done.
Test video:
Adding comments to Report
First, add Sales Comment line to the standard report using Report Extension. Unlike Note, this can be added directly via dataitem.
This time I’ll use Word Layout as an example.
Done.
Test video:
Great. 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)
Layout:
page 50129 "Sales Comments"
{
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = "Sales Comment Line";
InsertAllowed = false;
DeleteAllowed = false;
ModifyAllowed = false;
PageType = ListPart;
layout
{
area(content)
{
repeater(Group)
{
field(Date; Rec.Date)
{
Caption = 'Date';
}
field(Comment; Rec.Comment)
{
Caption = 'Comment';
}
}
}
}
actions
{
area(processing)
{
action(Comments)
{
ApplicationArea = All;
Caption = 'Comments';
Image = ViewComments;
RunObject = Page "Sales Comment Sheet";
RunPageLink = "Document Type" = field("Document Type"),
"No." = field("No."),
"Document Line No." = const(0);
}
}
}
}
pageextension 50129 SalesOrderExt extends "Sales Order"
{
layout
{
addbefore(Control1903720907)
{
part(SalesCommentsPart; "Sales Comments")
{
ApplicationArea = All;
SubPageLink = "Document Type" = field("Document Type"),
"No." = field("No."),
"Document Line No." = const(0);
}
}
}
}
reportextension 50129 StandardSalesOrderConfExt extends "Standard Sales - Order Conf."
{
dataset
{
addlast(Header)
{
dataitem(SalesCommentLine; "Sales Comment Line")
{
DataItemLink = "Document Type" = field("Document Type"),
"No." = field("No.");
DataItemLinkReference = Header;
column(Date; Date)
{
}
column(Comment; Comment)
{
}
}
}
}
}END
Hope this will help.
Thanks for reading.
ZHU
コメント