Altova MapForce 2022 Enterprise Edition

Defining Code Values at Message Level (Inline)

Home Prev Top Next

In a previous topic, Adapting Code Values from External Sources, you have seen how to configure field validation through custom code lists globally (it applies for any message that may be using a particular field). In the event that you need validation to apply only to a specific message, it is possible to add custom code lists inline (locally for a particular message). When you need to do this, follow the steps below:

 

1.If you haven't done that already, create a custom EDI Collection, see Creating a Custom EDI Collection.

2.In the directory of your custom EDI collection, find the {Message}.config file corresponding to the message of interest, and open in an XML Editor.

3.Find the <Data> element under the required <Segment>, and add the custom code values as children of <Values>, for example:

<Group name="Message_270-B1" info="Health Care Eligibility Benefit Inquiry" maxOccurs="unbounded">
    <Segment name="ST" info="Transaction Set Header">
      <Condition path="F1705" value="005010X279A1" />
      <Data ref="F143" info="Transaction Set Identifier Code">
        <Values>
          <Value Code="270" />

 

[>>>> custom values can be added here...]

 
        </Values>
      </Data>
      <Data ref="F329" info="Transaction Set Control Number" />
      <Data ref="F1705" info="Implementation Convention Reference" />
    </Segment>

 

Note the following:

 

When a field has both locally-defined values (such as those in the code listing above) and globally-defined code values (in a .codelist file, as shown in Adapting Code Values from External Sources), then make sure that local code values are also defined as global code values. Otherwise, a validation error*** will be raised: {Value} is not a legal value for field {Field}.

Inline (local) validation can be used if you require validation at field level (that is, the possible values that a field can take can be expressed as a list). Inline validation cannot be used for those fields that require complex validation rules at character level. When the field needs complex validation rules at character level (such as those defined in ISO 6346 applicable to Data Element 8155 of the UN/EDIFACT standard), add the code values globally, as shown in Adapting Code Values from External Sources. You can then configure validation as shown in Configuring Character-Level Validation.

 

*** Note that the actual validation outcome takes into account the settings configured for the rule "Invalid code list value" in the EDI Validation Settings dialog box. (To open this dialog box, click the Validation button on the EDI Component Settings dialog box).

© 2016-2022 Altova GmbH