この記事では、Dynamics 365 Finance、Enterprise Edition アプリケーション更新プログラム 7.3 で電子レポート (ER) フレームワークの API がどのように変更されるかについて説明します。
ER API には、次の 2 種類の変更が影響します。
- いくつかの X++ クラスが X++ から外部アセンブリに移動されました。
- 残りの X++ クラスは内部クラスです。
X++ から外部アセンブリに移動したクラスにアクセスする方法
外部クラスにアクセスするには、ファイルの先頭に using ディレクティブを追加します。
using Microsoft.Dynamics365.LocalizationFramework;
その後、追加の変更を加えずに外部クラスにアクセスできます。
var destination = new ERFileDestinationMemory();
名前空間のエイリアスを作成することもできます。
using LF = Microsoft.Dynamics365.LocalizationFramework;
作成した名前空間のエイリアスを使用して、外部のクラスを参照することができます。
var destination = new LF.ERFileDestinationMemory();
ERObjectsFactory を使用して内部 X++ オブジェクトにアクセスする方法
アプリケーションの更新プログラム 7.3 以降では、呼び出し元のコードは ERObjectsFactory クラスのメソッドを使用して ER オブジェクトにアクセスする必要があります。 これらの変更の例をいくつか示します。
フォーマット マッピング ルックアップを表示するコード
アプリケーション更新プログラム 7.3 より前
// pattern
ERFormatMappingTableLookup::lookupFormatMapping(<form control>, <model name>[, <data container name>]);
// sample code
ERFormatMappingTableLookup::lookupFormatMapping(_referenceGroupControl, bankLCMiscChargeReportERModelName);
アプリケーション更新プログラム 7.3 以降
// pattern
ERObjectsFactory::createFormatMappingTableLookupForControlAndModel(<form control>, <model name>[, <data container name>]).performFormLookup();
// sample code
ERObjectsFactory::createFormatMappingTableLookupForControlAndModel(_referenceGroupControl, bankLCMiscChargeReportERModelName).performFormLookup();
データ エクスポート用のフォーマット マッピングを実行するためのコード
アプリケーション更新プログラム 7.3 より前
// pattern
ERFormatMappingRun::constructByFormatMappingId(<format mapping id>, <file name>, <show prompt dialog>).run();
// sample code
ERFormatMappingRun::constructByFormatMappingId(erBinding, '', true).run();
アプリケーション更新プログラム 7.3 以降
// pattern
ERObjectsFactory::createFormatMappingRunByFormatMappingId(<format mapping id>, <file name>, <show prompt dialog>).run();
// sample code
ERObjectsFactory::createFormatMappingRunByFormatMappingId(erBinding, '', true).run();
データ インポート用の形式マッピングを実行するためのコード
アプリケーション更新プログラム 7.3 より前
// pattern
ERModelMappingDestinationRun::constructByImportFormatMappingId(<mapping id>, <integration point>).run();
// sample code
ERModelMappingDestinationRun::constructByImportFormatMappingId(custPaymModeTable.ERModelMappingTable, CustVendOutPaymConstants::IntegrationPoint).run();
アプリケーション更新プログラム 7.3 以降
// pattern
ERObjectsFactory::createMappingDestinationRunByImportFormatMappingId(<mapping id>, <integration point>).run();
// sample code
ERObjectsFactory::createMappingDestinationRunByImportFormatMappingId(custPaymModeTable.ERModelMappingTable, CustVendOutPaymConstants::IntegrationPoint).run();
ブラウザー ファイルの宛先を作成するためのコード
アプリケーション更新プログラム 7.3 より前
// sample code
new ERFileDestinationBrowser();
アプリケーション更新プログラム 7.3 以降
// sample code
ERObjectsFactory::createFileDestinationBrowser();
添付ファイルの宛先を作成するためのコード
アプリケーション更新プログラム 7.3 より前
// pattern
ERFileDestinationAttachment::construct(<record>, ERDocuManagement::instance().otherDocuType());
// sample code
ERFileDestinationAttachment::construct(_cashRegisterFiscalTrans_W, ERDocuManagement::instance().otherDocuType());
アプリケーション更新プログラム 7.3 以降
// pattern
ERObjectsFactory::createFileDestinationAttachmentWithOtherDocuType(<record>);
// sample code
ERObjectsFactory::createFileDestinationAttachmentWithOtherDocuType(_cashRegisterFiscalTrans_W);