Length Validation



Is there a way to have the validation process do a validation check on the length of the data in a given field against the EDI standard for that field?  If so, is also possible to have the data automatically truncated in conformance to the standard length for the given field?


  • Hi,

    This is base functionality, and all data elements annotated with StringLength attribute are validated for length by default. All EDI templates are matching the relevant standard, so you already have this type of validation.

    Data truncation is not available; however, it can be added later on if you submit a feature request to our support portal.

    Comment actions Permalink
  • Thanks Don,  I have a few follow up questions related to:

    1. Do the classes supplied by EdiFabric already have the data element fields annotated with the StringLength attribute matched to the EDI standards for data lengths (min & max)?  Or does the code need to be modified and attributes added and then libraries rebuilt?

    2. During the validation process, are validation errors generated for transactions that have missing segments and/or data elements that are required accounting to X12 and Edifact EDI standards?

    3. During the validation process, are conditional fields validated?  In other words, if a segment or element is not populated, but a conditional field is but only should be if the related segment or element is populated, will this condition generate a validation error?

    Lastly, if none of the above is validated by EdiFabric out of the box, what exactly is?  Also, examples on how to setup/use the above validation would be helpful if it exists in EdiFabric. 

    Comment actions Permalink
  • Hi Steve,

    My answers below:

    1. All classes already have the fields annotated with StringLength for the Enterprise plan. You can download those using the download link included in the confirmation email.
    2. Yes, missing segments/data elements are part of the validation/parsing. All segments/loops/elements annotated with [Required] attribute.
    3. This depends on whether the condition is a syntax note or situational. All syntax notes are added to the templates; however, the situational conditions are not. You need to implement the situational conditions as custom validation to plug them into the general validation execution.

    Here are some useful links:

    837P template with all attributes

    Conditional Attributes

    Custom Validation

    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post