Using the OCR Reference Interface
You can use Payment Management's OCR reference interface to create OCR-strings for use with customer documents such as invoices and reminders.
For more information on how to create and use dependencies see Microsoft Docs (search for Dependencies).
Use the icon and search for Sales & Receivables Setup.
On the Sales & Receivables Setup page under the FastTab General, ensure that the OCR Reference Type is defined.
Use the icon and search for Company Information.
On the Company Information under the FastTab Payments, ensure that the Bank Creditor No. is defined.
Create an app or add functionality to an existing app, having the following dependencies
The dependency for Payment and Reconciliation Formats (DK) is needed to get the Bank Creditor No. from the Company Information.
The dependency for Payment Management is needed to generate the payment ID.
Add a procedure to the report (or any other place of your choice).
To be able to print an OCR reference, a functionality must be added to a report. For simplicity the procedure can be added directly in the report. The following example uses a posted sales invoice and the standard Word report layout from Business Central.
The procedure creates an OCR reference that consists of:
- The OCR Reference type from the Sales & Receivables Setup
- The OCR reference based on the Document No.
- The Bank Creditor No. from the Company Information
In the report add the following procedure:
Please note that If you are using a version of Payment Management that does note contain the OCR Reference Type on the Sales & Receivables Setup you can hardcode the OCR Reference Type.
The procedure returns an OCR reference looking as the example below:
The procedure can be modified according to customer requirements.
Add a variable to the report of data type text to hold the OCR reference and call the procedure.
Add a call to the procedure by assigning the new variable with the return value from the procedure.
Add a new column to the dataset to be able to use the variable in the report layout.
Add the OCR reference to the layout. The OCR reference is a part of the reports dataset and can be added to the layout. This can be done regardless of the layout format (RDLC or Word). Identify the variable holding the OCR reference and place it in the layout. See this example of a Word layout.
Print the report and verify that the OCR reference is created. See this example of a printed report.