Project-Specific Customizations
These links take you to the individual sections on this page:
Integrate other fields into the process
Example: Change payment term in the workflow
Requirement
The vendor defined a payment term in the invoice which deviates from the standard of this vendor known to us. Users should be able to change the payment term of the current invoice in the workflow, and this change should be taken into consideration when creating the invoice in Microsoft Dynamics 365 Business Central.
Background
Usually you do not have to change the payment term key in the workflow and EASY Invoice does not have to pass it to Dynamics 365 Business Central. The payment terms being applied when creating the invoice via Business Central Connector are automatically determined in case of a purchase invoice without purchase order from the payment terms stored by the vendor, or incorporated from the purchase order.
Despite the named automatism it is possible to include a different payment term key for creating an invoice with Business Central Connector.
Solution
-
You need to find out via which page the list of existing payment term keys can be queried. In this case, it is page 4.
-
Create a new Web service for page 4.
-
Add a field for the payment term key to the EASY Invoice file type epiFiles, data type String.
-
Decide whether you want to access data from the shadow database or directly the Web service when selecting payment terms keys in the workflow. The advantage of the Shadow database variant is low latency and thus a dialog that quickly opens for users, as well as savings with the data volume, which otherwise makes an impact on communication with the cloud service. The disadvantage is possibly decrepit data because data matching is usually performed only once every day and the somewhat greater, one-off expenditure with setup. The advantages with the Direct query variant are in topicality of the data and its simpler setup. The disadvantages are higher latency and thus longer response times when displaying the dialog for users and the data volume that is consumed with communication with the cloud.
Shadow database variant
-
Create a new table in the database. InvoiceControlDb
-
Create a new DataTool that performs querying the payment term keys from the Web service and their storage in the DB table you have just created. In the Unique ID field, make sure the naming convention is correct so that the DataTool routinely performs ?? for all accounting entities/Business Central companies.
-
Create a new DataTool that reads the payment terms keys from the DB table and provides them as a UserExit for the field for payment terms keys for the file type epiFiles.
Direct query variant
-
Create a new DataTool that queries the payment terms keys from the Microsoft Dynamics 365 Business Central Web service and provides them as a UserExit for the file field for payment terms keys for the file type epiFiles.
-
Customize mapping in the transformation callscript cb.ehrmDataTools.transform.invoice2businesscentral in the header area that the content of the new file type field for payment terms keys is passed to the Dynamics 365 Business Central field Payment Terms Code (data field for payment terms keys).
Example: Include cost objects in purchase order lines
Requirement
In a new purchase order, the employees of the Procurement department assign the individual lines other cost objects, e.g. cost centers. This assignment should be reflected in the workflow, so the release path of purchase invoices can be controlled (cost center manager should release).
Background
In customizing Dynamics 365 Business Central, it is set that the cost center to be debited can be entered in the technical field Shortcut Dimension 1 Code, which pops up in the purchase order lines. Although the Shortcut_Dimension_1_Code field is basically included in the field list of the Web service for order lines, ECM_PurchaseOrderSubform, it is not considered by the Import DataTool Microsoft Business Central Connector - Import Purchase Order Item.
Solution
-
In the Import DataTool Microsoft Business Central Connector - Import Purchase Order Items, create a new line on the Mapping tab:
-
Source: "Shortcut_Dimension_1_Code"
-
Target: select any column from the custom columns of the InvoiceControlDb table that is still unused.
-
Transformation: none
-
Parameter: none
-
-
Customizing the mapping epiMappingConfig.arOrderItemUpdateDataMapping in the PortalScript epiMappingConfig, so that the value from the selected custom column is transferred to the Gentable lines of the respective invoice.
-
(Optional) Extending the mapping in the relevant UserExit DataTools
-
Extending the mapping for export to Dynamics 365 Business Central
-
To transmit new fields, you have to customize the transformation callbackscript cb.ehrmDataTools.transform.invoice2businesscentral - in this specific case, this is unnecessary because the Gentable field ItemCostCenter is already passed to an invoice line to the Shortcut Dimension 1 Code field by default.
-
If a field must be transferred at invoice header level, please customize the first Mapping object.
-
If you want to transfer a field at line level, you will have to customize the second Mapping object.
-
For mapping including a transformation that may be necessary, you have to specify a handlebars expression (see https://handlebarsjs.com/guide/). Example: "Currency Code": "{{Currency}}" where "Currency Code" represents the field name in Microsoft Dynamics 365 Business Central and "{{Currency}}" corresponds to the "Currency" field of the mapping type "epiFiles".
-
Handlebars expressions allow transforming values using so-called "helpers". Besides the default helpers built into Handlebars.js (https://handlebarsjs.com/guide/builtin-helpers.html), EASY provides other helpers.
Example: {{formatDate InvoiceDate 'dd.mm.yyyy' 'yyyy-mm-dd'}} returns a date existing as a string in the "InvoiceDate" file field to a target date format.
-
Modify synchronization in shadow database
Master data
The default, already configured, specifies that master data is fully synchronized once every day into the shadow database InvoiceControlDb per accounting entity.
Master data refers to:
-
Vendors
-
G/L accounts, items, resources, assets
-
Units of measure
-
Posting matrix (business posting group + product posting group)
-
Sales tax/VAT Posting matrix (sales tax/VAT Business posting group + sales tax/VAT product posting group)
-
Cost centers
-
Cost unit
You can:
-
completely withdraw accounting entities from synchronization (this affects the accounting entity's master and transaction data)
-
change frequency from daily to hourly (this affects all accounting entries)
-
influence the downloaded amount of data (this affects all accounting entries)
Withdrawing EASY Invoice account entity from synchronization
Enter the accounting entity for the Documents principal in the bccRecipientBlacklist property (example: ["Condex AG"]). It will no longer be automatically synchronized from now on.
Frequency
By changing the Unique ID on the Advanced tab of one of the Import DataTools, you can change frequency from daily to hourly. To do this, change the entry as follows where you replace the word daily with steady:
-
Example based on Import DataTool General Posting Setup: de.easy.bcc.import.daily.generalpostingsetup to de.easy.bcc.import.steady.generalpostingsetup
Influencing the amount of data
The OData Web services from Microsoft Dynamics 365 Business Central are used for sourcing data. OData is an HTTP-based protocol that supports so-called CRUD methods (Create, Read, Update, Delete).
OData allows you to specify filters, among other things, for Read queries. These filters are considered for internal data processing and you will get a filtered data object in JSON format in the server response. You can utilize this mechanism to limit the amount of data queried by the Import DataTools.
-
To query only goods receipt lines, for example, which have not yet been invoiced by the vendor, the ?$filter=Qty_Rcd_Not_Invoiced%20ne%200 expression can be appended in the "Data Tools Microsoft Business Central Connector - Import Receipt" DataTool to the URL in the "Source service" area. This corresponds to the statement "show only elements that do not contain 0 in the Qty_Rcd_Not_Invoiced field", i.e., only the lines not yet invoiced.
-
Whereas the ?$filter=No%20ne%20%27%27 expression at the end of the URL in the "Microsoft Business Central Connector - Import Purchase Return Order Item" DataTool ensures that the remark or comment rows from the lines of a return order are not queried and the shadow database table "receipts" are not written because we do not need them in the workflow.
To get an overview of the capabilities, it is worth looking at http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html .
Transaction data
The already configured default version provides that transaction data per accounting entity is completely synchronized in the shadow database InvoiceControlDb once every hour.
Transaction data refers to:
-
Purchase orders
-
Purchase order lines
-
Purchase return orders
-
Purchase return order lines
-
Goods receipt lines
-
Goods return lines
You can:
-
completely withdraw accounting entities from synchronization (this affects master and transaction data of the accounting entity)
-
change frequency from daily to hourly (this affects all accounting entries)
-
influence the downloaded amount of data (this affects all accounting entries)
Withdrawing EASY Invoice account entity from synchronization
See above under Master data.
Frequency
By changing the Unique ID on the Advanced tab of one of the Import DataTools, you can change frequency from hourly to daily. To do this, change the entry as follows where you replace the word steady with daily:
-
Example based on the Import DataTools "Microsoft Business Central Connector - Import Receipt: de.easy.bcc.import.steady.receipt to de.easy.bcc.import.daily.receipt
Influencing the amount of data
See above under Master data.