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.
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 creates a new record that will map the data model to data sources. In this example, you 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.
- In the Description field, type Payment model mapping CT.
- In the Definition field, type CustomerCreditTransferInitiation.
- Resolve changes 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.
- In the Label field, enter Transactions.
- In the Help field, enter Ledger journal lines.
- In the Ask for query field, select Yes.
- In the Table field, type 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 to add a new calculated field.
- In the Name field, type $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 to add a new calculated field.
- In the Name field, type $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 adds 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.
- In the Label field, enter Bank Account.
- In the Help field, enter Bank Account.
- Select Yes in the Ask for query field.
- In the Table field, type 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.
- In the Label field, type a value.
- In the Help field, enter Company information.
- Select Yes in the Ask for query field.
- In the Table field, type 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.
- In the Label field, enter 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.