Equisys technical notes

Technical guidance, explanations and fixes for our products

PRB: Export of reimbursable expense failed due to the length of the string

Print

ZTN4547

This Zetadocs technical note applies to:

  • Zetadocs Expenses Business Central Extension versions 1.2.20049.15 to1.2.20214.15

Symptom

There is a known problem that Zetadocs Expenses Essentials users may encounter when trying to export certain expenses with the error showing as in the similar example below:

“Export of reimbursable expenses failed. Validation error when initializing purchase line. Unhandled exception: The length of the string is 57, but it must be less than or equal to 50 characters.”

Cause

The maximum number of characters in the description field on a purchase invoice line is 50. An export description using Format 2 or Automatic uses a combination of the Expense ID, User ID and Expense Type Name concatenated together. These will usually result in a successful export as the information is trimmed at the server to be 50 characters on the extension versions list. However, in case of having adjustment lines we would have added in an extension of additional 7 for suffix ' - Adj.' which can cause 57 characters and throw the error.

The user ID field is intended to be a short form for an employee's payroll number, but users who have set the User ID to something else, e.g. an e-mail address are likely to hit the 50 character limit and encounter this issue.

Resolution

There are 2 workarounds for this issue on the extension versions listed:

- Use Format 1 as the export description format.

- Modify one of the affected fields to be shorter (e.g. set user ID field to be a payroll number rather than email address)

Status

Equisys is aware of this bug and a solution has been found in the later release.

Last updated: 14th October 2020 (AL/NT) 

Keywords: Expense ID, Export

Equisys Logo, Document Management and Expense Management for Business Central
 

Replaced by script