Redefining the output type tree

Open the flatinvc.mtt example type tree in the Type Designer. Save this type tree under a different name, for example flatinvc2.mtt.

About this task

Note: Do not overwrite the flatinvc.mtt type tree, which installed in the directory: install_dir\Supplychain_EDI_vn.n.n\wtx\examples\ansi\editoinv

Now, create the Transaction and LineItem subtypes under the group type Error. The Transaction type represents a Transaction error and the LineItem type represents a LineItem error. The definition of a Transaction Error does not require changes because it is the same as the Error definition in the previous map. Add a few fields that are components of LineItem Error.

To determine which transactions contained the bad line item, create an item type Transaction# as a subtype of the Field category. Create another item type BadLineItem to map each rejected line item. BadLineItem has an indefinite maximum size.

Next, add two components to Error. Drag Transaction# and BadLineItem from the tree into the Error FlatInvoice group component window. This defines these items as components of LineItem Error.

Now edit the components of LineItem Error. Delete the inherited component Bad810 and add BadLineItem and Transaction# to the component list.

Make a header for each Transaction Error and each LineItem Error, to indicate the error type. Edit the properties of Transaction Error and define the initiator as the text There is an error in the following invoice:

Define the initiator for the LineItem Error as the text There is an error in the following line item:

Define a carriage return after each error header. It is probably easiest to define the initiator of the object that follows the header, which is ErrorMsg. So, define the initiator for ErrorMsg as a carriage return/linefeed.

Next, define the components of ErrorFile as Transaction Error(s) followed by LineItem Error(s).

This completes the definition of the new error file.