Dynamics 365 Business Central 用 BarTender Print Connector に印刷アクションを追加する方法
概要
このガイドはBusiness Centralの開発者向けです。以下の内容を理解していることを前提としています:
- VS Codeでページ拡張を作成する手順
- ALプログラミングの基本
- VS Codeからサンドボックス環境へ変更を公開する方法
- 本番環境へのアプリのデプロイ方法
以下のガイドでは、BarTender CloudおよびDynamics 365 Business Central用BarTender Print Connectorで使用するカスタム印刷アクションの作成手順を説明します。
対象製品
BarTender Cloud
Dynamics 365 Business Central用BarTender Print Connector
情報
カード、ドキュメント、サブフォームページの場合
- 以下のコードをページ拡張に追加します。
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> に置き換えます。
追加リソース
Dynamics 365 Business Central用BarTender Print Connectorのインストールとセットアップ