Define ER model mappings and select data sources for them
The following steps explain how a user in the System Administrator or Electronic Reporting Developer role can select data sources for an Electronic reporting (ER) data model. The data sources are bound to individual components of the selected data model at design time and populate business data to that data model at runtime. In this example, you select data sources for an existing data model created for the sample company Litware, Inc.
To perform these steps, you must first complete the steps in the Create a new data model procedure.
Open the Electronic Reporting configurations tree
- Go to Organization administration > Workspaces > Electronic reporting.
- Click Reporting configurations.
Insert a new model mapping
- In the tree, select 'Payments (simplified model)'.
- Click Designer.
- Click Map model to datasource.
- Click New.
- This will create a new record that will map the data model to data sources. In this example, you will map the data model to data sources for the desired payment type: credit transfer. It is possible to design more than one mapping for a particular data model. For example, you could create a mapping for the different types of payments, such as for direct debit or for credit transfers. In this example, you will create a mapping for credit transfers.
- In the Name field, type 'CT mapping'.
- CT mapping
- In the Description field, type 'Payment model mapping CT'.
- Payment model mapping CT
- In the Definition field, type 'CustomerCreditTransferInitiation'.
- CustomerCreditTransferInitiation
- ResolveChanges the Definition.
- Click Save.
Define required data sources for the current model mapping
- Click Designer.
- In the tree, select 'Dynamics 365 for Operations\Table records'.
- Click Add root.
- Enter this data source to access payment transactions.
- In the Name field, type 'Transactions'.
- Transactions
- In the Label field, enter 'Transactions'.
- Transactions
- In the Help field, enter 'Ledger journal lines'.
- Ledger journal lines
- Select Yes in the Ask for query field.
- Select Yes.
- In the Table field, type 'LedgerJournalTrans'.
- LedgerJournalTrans
- Click OK.
- Select the LedgerJournalTrans table as a data source for the current data model.
- In the tree, select 'Functions\Calculated field'.
- Click Add.
- Click Add to add a new calculated field.
- In the Name field, type '$EndToEndID'.
- $EndToEndID
- Click Edit formula.
- In the tree, select 'String\CONCATENATE'.
- Click Add function.
- In the tree, expand 'Transactions'.
- In the tree, select 'Transactions\Voucher'.
- Click Add data source.
- In the Formula field, enter 'CONCATENATE(Transactions.Voucher, "-", '.
- Type [ , "-", ] at the end of the formula.
- In the tree, select 'String\TEXT'.
- Click Add function.
- In the tree, select 'Transactions\Record-ID(RecId)'.
- Click Add data source.
- In the Formula field, enter 'CONCATENATE(Transactions.Voucher, "-", TEXT(Transactions.RecId))'.
- Type [))] at the end of the formula.
- Click Save.
- Make sure that no errors have been discovered for the created formula. See the ERRORS tab below the formula editor control.
- Close the page.
- Click OK.
- Add the calculated field to this data source.
- Click Add.
- Click Add to add a new calculated field.
- In the Name field, type '$Amount'.
- $Amount
- Click Edit formula.
- In the tree, expand 'Transactions'.
- In the tree, select 'Transactions\Debit(AmountCurDebit)'.
- Click Add data source.
- In the Formula field, enter 'Transactions.AmountCurDebit - '.
- Type [ - ] at the end of the formula.
- In the tree, select 'Transactions\Credit(AmountCurCredit)'.
- Click Add data source.
- Click Save.
- Close the page.
- Click OK.
- This will add the $Amount calculated field to the selected data source for the current data model.
- In the tree, select 'Transactions$Amount'.
- In the tree, expand 'Transactions'.
- In the tree, expand or collapse 'Transactions$Amount'.
- In the tree, expand or collapse 'Transactions'.
- In the tree, select 'Dynamics 365 for Operations\Table records'.
- Click Add root.
- Enter this data source to access the company's bank account details.
- In the Name field, type 'BankAccount'.
- BankAccount
- In the Label field, enter 'Bank Account'.
- Bank Account
- In the Help field, enter 'Bank Account'.
- Bank Account
- Select Yes in the Ask for query field.
- Select Yes.
- In the Table field, type 'BankAccountTable'.
- BankAccountTable
- Click OK.
- Select the BankAccountTable table as a data source for the current data model.
- Click Add root.
- Enter this data source to access the company's requisites.
- In the Name field, type 'Company'.
- Company
- In the Label field, type a value.
- Company information
- In the Help field, enter 'Company information'.
- Company information
- Select Yes in the Ask for query field.
- Select Yes.
- In the Table field, type 'CompanyInfo'.
- CompanyInfo
- Click OK.
- Select the CompanyInfo table as a data source for the current data model.
- In the tree, select 'Functions\Calculated field'.
- Click Add root.
- Insert a calculated field as a new data source.
- In the Name field, type 'ProcessingDateTime'.
- ProcessingDateTime
- In the Label field, enter 'Processing date & time'.
- Processing date & time
- Click Edit formula.
- In the tree, select 'Date/time\SESSIONNOW'.
- Click Add function.
- Click Save.
- Close the page.
- Click OK.
- Add the ProcessingDateTime calculated field as a data source for the current data model.
- Click Save.
- Close the page.
- Close the page.
- Close the page.