Customizing Archiving in D365 Finance

  1. Add custom fields
  2. History Tables
  3. Business entity
  4. Operating Mode 
  5. Add new tables
  6. Names of D365FO tables

This post describes briefly how the archiving feature in Microsoft Dynamics 365 Finance and Operations applications supports customization. The archive framework supports extensions to include custom table fields and custom tables in supported functional scenarios.

Custom fields added to a standard table must be added to the corresponding history table (suffixed History) and to the Business Intelligence entity: BI (suffixed BIEntity). The custom BI entity must be updated in Dataverse to archive data with Dataverse long term retention.

Transaction records are moved to the history tables. The schema of a history table must match its corresponding active table. All columns of the current table must be present in its mirror history table.

Column exclusion rule: SysRowVersion the SysDataStatecolumns are added by the platform and managed using the properties of the table metadata. These columns do not need to be added to the history tables.

Dataverse interacts with Finance and Operations. These virtual entities are used to retrieve data from the Finance and Operations database and save it in corresponding tables in Dataverse’s long-term retention.

  • Step 1: add fields to the history table via extensions. The archive framework requires that all active table columns are reflected in the corresponding history tables. Use table extensions to add custom fields to history tables.
  • Step 2: add fields to BI entities via extensions: Additional fields added to live tables must be added to the corresponding BI entities.
  • Step 3: Refresh the virtual entity in Dataverse: The custom business entity must be refreshed in Dataverse to archive the data into the Dataverse Long-Term Retention Store.

Additional tables can be included in the archive scenario if they have a direct or indirect relationship to the live master table.

To create a history table that matches the live table in the archive scope, proceed as follows.

  • Create a new history table that reflects all the fields in the corresponding active table, including all metadata properties of the active table.
  • Do not mirror the indexes of the current table in the history table. For most history tables, a clustered index on the column RecId is sufficient. Create an additional index to improve query performance if necessary and maintain foreign key relationships.
  • Extend ArchiveAutomationJobRequestCreatorclasse for a scenario to add the new table to the archive table chart: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/sysadmin/archive-custom#code-example
ScenarioLive tableHistory tableBI entityDataverse-managed data lake table
Finance General ledgerGENERALJOURNALACCOUNTENTRYGENERALJOURNALACCOUNTENTRYHISTORYGeneraljournalaccountentryBiEntitymserp_GeneraljournalaccountentryBiEntity
GENERALJOURNALACCOUNTENTRY_WGENERALJOURNALACCOUNTENTRYHISTORY_WGeneraljournalaccountentrywBiEntitymserp_GeneraljournalaccountentrywBiEntity
GENERALJOURNALENTRYGENERALJOURNALENTRYHISTORYcusmserp_GeneraljournalentryBiEntity
GENERALJOURNALENTRY_WGENERALJOURNALENTRYHISTORY_WGeneraljournalentrywBiEntitymserp_GeneraljournalentrywBiEntity
LEDGERCONSOLIDATEHISTREFLEDGERCONSOLIDATEHISTREFHISTORYLedgerconsolidatehistrefBiEntitymserp_LedgerconsolidatehistrefBiEntity
LEDGERENTRYLEDGERENTRYHISTORYLedgerentryBiEntitymserp_LedgerentryBiEntity
LEDGERENTRYJOURNALLEDGERENTRYJOURNALHISTORYLedgerentryjournalBiEntitymserp_LedgerentryjournalBiEntity
LEDGERENTRYJOURNALIZINGLEDGERENTRYJOURNALIZINGHISTORYLedgerentryjournalizingBiEntitymserp_LedgerentryjournalizingBiEntity
LEDGERTRANSSETTLEMENTLEDGERTRANSSETTLEMENTHISTORYLedgertranssettlementBiEntitymserp_LedgertranssettlementBiEntity
SUBLEDGERVOUCHERGENERALJOURNALENTRYSUBLEDGERVOUCHERGENERALJOURNALENTRYHISTORYSubledgervouchergeneraljournalentryBiEntitymserp_SubledgervouchergeneraljournalentryBiEntity
Supply Chain Management Sales orderMCRRETURNSALESTABLEMCRRETURNSALESTABLEHISTORYMcrreturnsalestableBiEntitymserp_McrreturnsalestableBiEntity
MCRSALESLINEMCRSALESLINEHISTORYMcrsaleslineBiEntitymserp_McrsaleslineBiEntity
MCRSALESTABLEMCRSALESTABLEHISTORYMcrsalestableBiEntitymserp_McrsalestableBiEntity
RETAILSALESLINERETAILSALESLINEHISTORYRetailsaleslineBiEntitymserp_RetailsaleslineBiEntity
RETAILSALESTABLERETAILSALESTABLEHISTORYRetailsalestableBiEntitymserp_RetailsalestableBiEntity
SALESLINESALESLINEHISTORYSaleslineBiEntitymserp_SaleslineBiEntity
SALESLINE_BRSALESLINEHISTORY_BRSaleslinebrBiEntitymserp_SaleslinebrBiEntity
SALESLINE_INSALESLINEHISTORY_INSaleslineinBiEntitymserp_SaleslineinBiEntity
SALESLINE_WSALESLINEHISTORY_WSaleslinewBiEntitymserp_SaleslinewBiEntity
SALESTABLESALESTABLEHISTORYSalestableBiEntitymserp_SalestableBiEntity
SALESTABLE_BRSALESTABLEHISTORY_BRSalestablebrBiEntitymserp_SalestablebrBiEntity
SALESTABLE_RUSALESTABLEHISTORY_RUSalestableruBiEntitymserp_SalestableruBiEntity
SALESTABLE_WSALESTABLEHISTORY_WSalestablewBiEntitymserp_SalestablewBiEntity
Supply Chain Management Inventory transactionINVENTTRANSARCHIVEINVENTTRANSARCHIVEHISTORYInventtransarchiveBiEntitymserp_InventTransArchiveBiEntity
Supply Chain Management Inventory JournalINVENTJOURNALTABLEINVENTJOURNALTABLEHISTORYInventjournaltableBiEntitymserp_InventjournaltableBiEntity
INVENTJOURNALTABLE_ININVENTJOURNALTABLE_INHISTORYInventjournaltableinBiEntitymserp_InventjournaltableinBiEntity
INVENTJOURNALTRANSINVENTJOURNALTRANSHISTORYInventjournaltransBiEntitymserp_InventjournaltransBiEntity
INVENTJOURNALTRANS_ININVENTJOURNALTRANS_INHISTORYInventjournaltransinBiEntitymserp_InventjournaltransinBiEntity
Finance Tax TransTAXTRANSTAXTRANSHISTORYTaxtransBiEntitymserp_TaxtransBiEntity
TAXTRANS_BRTAXTRANSHISTORY_BRTaxtransbrBiEntitymserp_TaxtransbrBiEntity
TAXTRANSGENERALJOURNALACCOUNTENTRYTAXTRANSGENERALJOURNALACCOUNTENTRYHISTORYTaxtransgeneraljournalaccountentryBiEntitymserp_TaxtransgeneraljournalaccountentryBiEntity
TAXTRANS_INTAXTRANSHISTORY_INTaxtransinBiEntitymserp_TaxtransinBiEntity
TAXTRANS_ITTAXTRANSHISTORY_ITTaxtransitBiEntitymserp_TaxtransitBiEntity
TAXTRANS_REPORTINGTAXTRANSHISTORY_REPORTINGTaxtransreportingBiEntitymserp_TaxtransreportingBiEntity
TAXTRANS_RUTAXTRANSHISTORY_RUTaxtransruBiEntitymserp_TaxtransruBiEntity
TAXTRANSSUBLEDGERJOURNALACCOUNTENTRYTAXTRANSSUBLEDGERJOURNALACCOUNTENTRYHISTORYTaxtranssubledgerjournalaccountentryBiEntitymserp_TaxtranssubledgerjournalaccountentryBiEntity
TAXTRANS_THTAXTRANSHISTORY_THTaxtransthBiEntitymserp_TaxtransthBiEntity
TAXTRANS_WTAXTRANSHISTORY_WTaxtranswBiEntitymserp_TaxtranswBiEntity