Επεξεργασία

Κοινή χρήση μέσω


ER framework API changes for Application update 7.3

This article describes how the API of the Electronic reporting (ER) framework has been changed in the Dynamics 365 Finance, Enterprise edition Application update 7.3.

There are two types of changes to the ER APIs:

  • Several X++ classes were moved from X++ to an external assembly.
  • The rest of X++ classes were marked as internal.

How to access classes that were moved from X++ to an external assembly

To access external classes, you need to add the using directive to the beginning of your file.

using Microsoft.Dynamics365.LocalizationFramework;

You can then access an external class without any additional changes, for example.

var destination = new ERFileDestinationMemory();

You can also create an alias for your namespace.

using LF = Microsoft.Dynamics365.LocalizationFramework;

You can then refer to an external class by using the namespace alias that you created.

var destination = new LF.ERFileDestinationMemory();

How to access internal X++ objects by using ERObjectsFactory

In Application update 7.3 and later updates, the calling code must access the ER objects by using the methods of the ERObjectsFactory class. Several examples of these changes are shown.

Code to display a format mapping lookup

Before Application update 7.3

// pattern
ERFormatMappingTableLookup::lookupFormatMapping(<form control>, <model name>[, <data container name>]);
// sample code
ERFormatMappingTableLookup::lookupFormatMapping(_referenceGroupControl, bankLCMiscChargeReportERModelName);

Application update 7.3 and later

// pattern
ERObjectsFactory::createFormatMappingTableLookupForControlAndModel(<form control>, <model name>[, <data container name>]).performFormLookup();
// sample code
ERObjectsFactory::createFormatMappingTableLookupForControlAndModel(_referenceGroupControl, bankLCMiscChargeReportERModelName).performFormLookup();

Code to run a format mapping for data export

Before Application update 7.3

// pattern
ERFormatMappingRun::constructByFormatMappingId(<format mapping id>, <file name>, <show prompt dialog>).run();
// sample code
ERFormatMappingRun::constructByFormatMappingId(erBinding, '', true).run();

Application update 7.3 and later

// pattern
ERObjectsFactory::createFormatMappingRunByFormatMappingId(<format mapping id>, <file name>, <show prompt dialog>).run();
// sample code
ERObjectsFactory::createFormatMappingRunByFormatMappingId(erBinding, '', true).run();

Code to run a format mapping for data import

Before Application update 7.3

// pattern
ERModelMappingDestinationRun::constructByImportFormatMappingId(<mapping id>, <integration point>).run();
// sample code
ERModelMappingDestinationRun::constructByImportFormatMappingId(custPaymModeTable.ERModelMappingTable, CustVendOutPaymConstants::IntegrationPoint).run();

Application update 7.3 and later

// pattern
ERObjectsFactory::createMappingDestinationRunByImportFormatMappingId(<mapping id>, <integration point>).run();
// sample code
ERObjectsFactory::createMappingDestinationRunByImportFormatMappingId(custPaymModeTable.ERModelMappingTable, CustVendOutPaymConstants::IntegrationPoint).run();

Code to create a browser file destination

Before Application update 7.3

// sample code
new ERFileDestinationBrowser();

Application update 7.3 and later

// sample code
ERObjectsFactory::createFileDestinationBrowser();

Code to create an attachment file destination

Before Application update 7.3

// pattern
ERFileDestinationAttachment::construct(<record>, ERDocuManagement::instance().otherDocuType());
// sample code
ERFileDestinationAttachment::construct(_cashRegisterFiscalTrans_W, ERDocuManagement::instance().otherDocuType());

Application update 7.3 and later

// pattern
ERObjectsFactory::createFileDestinationAttachmentWithOtherDocuType(<record>);
// sample code
ERObjectsFactory::createFileDestinationAttachmentWithOtherDocuType(_cashRegisterFiscalTrans_W);