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.
Add custom fields
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.
History Tables
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.
Business entity
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.
Operating Mode
- 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.
Add new tables
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
Names of D365FO tables
| Scenario | Live table | History table | BI entity | Dataverse-managed data lake table |
| Finance General ledger | GENERALJOURNALACCOUNTENTRY | GENERALJOURNALACCOUNTENTRYHISTORY | GeneraljournalaccountentryBiEntity | mserp_GeneraljournalaccountentryBiEntity |
| GENERALJOURNALACCOUNTENTRY_W | GENERALJOURNALACCOUNTENTRYHISTORY_W | GeneraljournalaccountentrywBiEntity | mserp_GeneraljournalaccountentrywBiEntity | |
| GENERALJOURNALENTRY | GENERALJOURNALENTRYHISTORY | cus | mserp_GeneraljournalentryBiEntity | |
| GENERALJOURNALENTRY_W | GENERALJOURNALENTRYHISTORY_W | GeneraljournalentrywBiEntity | mserp_GeneraljournalentrywBiEntity | |
| LEDGERCONSOLIDATEHISTREF | LEDGERCONSOLIDATEHISTREFHISTORY | LedgerconsolidatehistrefBiEntity | mserp_LedgerconsolidatehistrefBiEntity | |
| LEDGERENTRY | LEDGERENTRYHISTORY | LedgerentryBiEntity | mserp_LedgerentryBiEntity | |
| LEDGERENTRYJOURNAL | LEDGERENTRYJOURNALHISTORY | LedgerentryjournalBiEntity | mserp_LedgerentryjournalBiEntity | |
| LEDGERENTRYJOURNALIZING | LEDGERENTRYJOURNALIZINGHISTORY | LedgerentryjournalizingBiEntity | mserp_LedgerentryjournalizingBiEntity | |
| LEDGERTRANSSETTLEMENT | LEDGERTRANSSETTLEMENTHISTORY | LedgertranssettlementBiEntity | mserp_LedgertranssettlementBiEntity | |
| SUBLEDGERVOUCHERGENERALJOURNALENTRY | SUBLEDGERVOUCHERGENERALJOURNALENTRYHISTORY | SubledgervouchergeneraljournalentryBiEntity | mserp_SubledgervouchergeneraljournalentryBiEntity | |
| Supply Chain Management Sales order | MCRRETURNSALESTABLE | MCRRETURNSALESTABLEHISTORY | McrreturnsalestableBiEntity | mserp_McrreturnsalestableBiEntity |
| MCRSALESLINE | MCRSALESLINEHISTORY | McrsaleslineBiEntity | mserp_McrsaleslineBiEntity | |
| MCRSALESTABLE | MCRSALESTABLEHISTORY | McrsalestableBiEntity | mserp_McrsalestableBiEntity | |
| RETAILSALESLINE | RETAILSALESLINEHISTORY | RetailsaleslineBiEntity | mserp_RetailsaleslineBiEntity | |
| RETAILSALESTABLE | RETAILSALESTABLEHISTORY | RetailsalestableBiEntity | mserp_RetailsalestableBiEntity | |
| SALESLINE | SALESLINEHISTORY | SaleslineBiEntity | mserp_SaleslineBiEntity | |
| SALESLINE_BR | SALESLINEHISTORY_BR | SaleslinebrBiEntity | mserp_SaleslinebrBiEntity | |
| SALESLINE_IN | SALESLINEHISTORY_IN | SaleslineinBiEntity | mserp_SaleslineinBiEntity | |
| SALESLINE_W | SALESLINEHISTORY_W | SaleslinewBiEntity | mserp_SaleslinewBiEntity | |
| SALESTABLE | SALESTABLEHISTORY | SalestableBiEntity | mserp_SalestableBiEntity | |
| SALESTABLE_BR | SALESTABLEHISTORY_BR | SalestablebrBiEntity | mserp_SalestablebrBiEntity | |
| SALESTABLE_RU | SALESTABLEHISTORY_RU | SalestableruBiEntity | mserp_SalestableruBiEntity | |
| SALESTABLE_W | SALESTABLEHISTORY_W | SalestablewBiEntity | mserp_SalestablewBiEntity | |
| Supply Chain Management Inventory transaction | INVENTTRANSARCHIVE | INVENTTRANSARCHIVEHISTORY | InventtransarchiveBiEntity | mserp_InventTransArchiveBiEntity |
| Supply Chain Management Inventory Journal | INVENTJOURNALTABLE | INVENTJOURNALTABLEHISTORY | InventjournaltableBiEntity | mserp_InventjournaltableBiEntity |
| INVENTJOURNALTABLE_IN | INVENTJOURNALTABLE_INHISTORY | InventjournaltableinBiEntity | mserp_InventjournaltableinBiEntity | |
| INVENTJOURNALTRANS | INVENTJOURNALTRANSHISTORY | InventjournaltransBiEntity | mserp_InventjournaltransBiEntity | |
| INVENTJOURNALTRANS_IN | INVENTJOURNALTRANS_INHISTORY | InventjournaltransinBiEntity | mserp_InventjournaltransinBiEntity | |
| Finance Tax Trans | TAXTRANS | TAXTRANSHISTORY | TaxtransBiEntity | mserp_TaxtransBiEntity |
| TAXTRANS_BR | TAXTRANSHISTORY_BR | TaxtransbrBiEntity | mserp_TaxtransbrBiEntity | |
| TAXTRANSGENERALJOURNALACCOUNTENTRY | TAXTRANSGENERALJOURNALACCOUNTENTRYHISTORY | TaxtransgeneraljournalaccountentryBiEntity | mserp_TaxtransgeneraljournalaccountentryBiEntity | |
| TAXTRANS_IN | TAXTRANSHISTORY_IN | TaxtransinBiEntity | mserp_TaxtransinBiEntity | |
| TAXTRANS_IT | TAXTRANSHISTORY_IT | TaxtransitBiEntity | mserp_TaxtransitBiEntity | |
| TAXTRANS_REPORTING | TAXTRANSHISTORY_REPORTING | TaxtransreportingBiEntity | mserp_TaxtransreportingBiEntity | |
| TAXTRANS_RU | TAXTRANSHISTORY_RU | TaxtransruBiEntity | mserp_TaxtransruBiEntity | |
| TAXTRANSSUBLEDGERJOURNALACCOUNTENTRY | TAXTRANSSUBLEDGERJOURNALACCOUNTENTRYHISTORY | TaxtranssubledgerjournalaccountentryBiEntity | mserp_TaxtranssubledgerjournalaccountentryBiEntity | |
| TAXTRANS_TH | TAXTRANSHISTORY_TH | TaxtransthBiEntity | mserp_TaxtransthBiEntity | |
| TAXTRANS_W | TAXTRANSHISTORY_W | TaxtranswBiEntity | mserp_TaxtranswBiEntity |

Leave a comment