Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page lists all the possible errors that can occur when evaluating the user specified expressions in the label formats, workflow assignment rules, edit check rules etc.

1. Error during the specimen collection — Substring used in label format

When user used the substring function in label format, and somehow it’s not getting the input that is expected, user will get the below error message.

Error evaluating the expression: #specimen.parentSpecimen.label.substring(0, #specimen.parentSpecimen.label.indexOf('_', #specimen.parentSpecimen.label.indexOf('_') + 1)). Error: StringIndexOutOfBoundsException: begin 0, end -1, length 5. Refer to the Wiki article (COMMON_EVAL_EXPR_ERROR)

How to resolve it?

You need to fix the label format to make sure, your substring is correctly generating.

In the above example, The error occurred because the parent specimen does not have 2 underscores. To fix this, the user has to check what all fields used in the parent label format, in this case, specimen level custom field is used, and the form was not attached to that CP. You need to attach the form and this will solve your issue.