如何將列印動作新增至 Dynamics 365 Business Central 的 BarTender 列印連接器
概覽
本指南僅適用於 Business Central 開發人員。假設您已經了解並熟悉以下內容:
- 在 VS code 中建立頁面擴充的流程
- AL 程式設計的基本知識
- 如何將變更從 VS code 發佈到沙盒環境
- 應用程式部署到正式環境
請參閱下方指南,瞭解如何建立自訂列印動作,以搭配 BarTender Cloud 及 BarTender Print Connector for Dynamics 365 Business Central 使用。
適用於
BarTender Cloud
BarTender Print Connector for Dynamics 365 Business Central
資訊
適用於卡片、文件或子表單頁面
- 將下方程式碼加入您的頁面擴充中。
actions
{
addfirst(processing)
{
group(SSBT_Actions)
{
Caption = 'Seagull Bartender';
Image = Action;
action(SSBT_PrintSelected)
{
ApplicationArea = All;
Caption = 'Print';
Image = Print;
ToolTip = 'Print record.'
trigger OnAction()
var
_rec: Record Item;
_recRef: RecordRef;
begin
SetSelectionFilter(_rec);
_recRef.Open(Database::Item);
_recRef.Copy(_rec);
SSBTPrintMgmt.PrintBartender(_recRef, true);
end;
}
}
}
}
var
SSBTPrintMgmt: Codeunit "SSBT Print Mgmt";
- 將 _rec: Record Item 變數改為頁面擴充的 _rec: Record <SourceTable.Name>。
- 找到 Datasase::Item 並將其替換為 Database::<SourceTable.Name>.
適用於清單頁面
- 將下方程式碼加入您的頁面擴充中。
actions
{
addfirst(processing)
{
group(SSBT_Actions)
{
Caption = 'Seagull Bartender';
Image = Action;
action(SSBT_PrintSelected)
{
ApplicationArea = All;
Caption = 'Print selected';
Image = Print;
ToolTip = 'Print selected records.';
trigger OnAction()
var
_rec: Record Item;
_recRef: RecordRef;
begin
SetSelectionFilter(_rec);
_recRef.Open(Database::Item);
_recRef.Copy(_rec);
SSBTPrintMgmt.PrintBartender(_recRef, true);
end;
}
action(SSBT_PrintAll)
{
ApplicationArea = All;
Caption = 'Print all';
Ellipsis = true;
Image = SendToMultiple;
ToolTip = 'Print all records.';
trigger OnAction()
var
_recRef: RecordRef;
begin
_recRef.Open(Database::Item);
_recRef.Copy(Rec);
SSBTPrintMgmt.PrintBartender(_recRef, false);
end;
}
}
}
}
var
SSBTPrintMgmt: Codeunit "SSBT Print Mgmt";
- 將 _rec: Record Item 變數改為頁面擴充的 _rec: Record <SourceTable.Name>。
- 找到 Datasase::Item 並將其替換為 Database::<SourceTable.Name>.
其他資源
安裝與設定 BarTender Print Connector for Dynamics 365 Business Central
使用 BarTender Print Connector for Dynamics 365 Business Central 進行列印