EDI Output
    • 08 Oct 2024
    • 3 Minutes to read
    • Contributors
    • PDF

    EDI Output

    • PDF

    Article summary

    An output can be created in the EDI format. The Form Engine retrieves data from the input grab file, processes it, maps it to fields in the output, and automatically converts the result to EDI.

    In this exercise, you are proposed to create a structure of the output in the EDI format.

    Exercise

    Download and import the attached configuration called 04. EDI Output in Lasernet Developer 9. Afterward, navigate to the Forms section and open the Sample form.

    Start by opening the template based on which you create the output. Then, follow these steps:

    1. On the toolbar, click Open Template.

    2. In the Open Template dialog displayed, select a template, and then click Open.

    It is the right time to add patterns and rearranges and edit their formats. To make adding patterns and rearranges to the input possible, switch to the XML tab in the output.

    1. Use the Rearrange tool to add rearranges to the following elements in the input:

    • <InvoicingName>

    • <InvoicingAddress>

    • <InvoicingTown>

    • <InvoicingZip>

    • <InvoiceId>

    • <InvoiceDate>

    1. Edit a format for the rearrange added to the <InvoiceDate> element. To this end, double-click the rearrange.

    2. In the Edit XML Rearrange dialog displayed, switch to the Formats tab.

    3. From the Format category drop-down box, select Date.

    4. Switch to the Input format tab, and then select the Override form input format check box.

    5. Click the Add button.

    6. In the dialog displayed, select dd-MM-yyyy from the Regional profile drop-down box, and then click Ok.

    Once you are done, click Ok in the Edit XML Rearrange dialog to confirm changes.

    1. In the input, add a pattern to the <Body_CustInvoiceTrans> element by using the Pattern tool available on the Developer toolbar.

    As a result, the pattern is added to each <Body_CustInvoiceTrans> element available in the input.

    1. Afterward, use the Rearrange tool available on the Developer toolbar to add rearranges to the following elements under the <Body_CustInvoiceTrans> one:

    • <ItemID>

    • <Name>

    • <Qty>

    • <SalesPrice>

    • <LineAmount>

    As you can see, rearranges are added under each <Body_CustInvoiceTrans> element available in the input.

    Once you have added rearranges, edit a format for the rearrange added to the <Qty>, <SalesPrice>, and <LineAmount> elements. For all of them, set the Number format category. Additionally, for the rearrange added to the <Qty> element, select the Override sheet output format check box on the Output format tab of the Edit XML Rearrange dialog, and then type 0 in the Number of decimals text box. For the rearranges added to the <SalesPrice> and <LineAmount> elements, select the Override sheet output format checkbox on the Output format tab available on the Formats tab of the Edit XML Rearrange dialog.

    1. In the output on the XML tab, right-click the <EDI> node, and then click Expand All on the context menu that appears.

    1. Double-click a node in the output to edit its properties.

    2. Select the Use default value if no rearrange data is provided checkbox. Once you are done, click Ok.

    Do it for every single node available in the output. As a result, you can see that a value in each node is not dimmed anymore and is shown in black.

    It is the right time to connect the pattern and rearranges you have added to the input with elements in the output, one by one, in a sequence they are available in the input using any of two possible options: either dragging  a pattern/rearrange from the input to the required element in the output or selecting the required element of the output by tagging its path. For more information, see CSV Output.

    Add a script to the output. To this end, follow the steps listed below:

    1. On the Developer toolbar, click Text.

    2. When a pointer becomes a cross, click the node in the output as it is shown in the following image:

    1. At the mouse release, the New Insert Text is shown as a node value. Double-click it.

    2. In the Edit XML Rearrange dialog, switch to the Objects tab.

    3. Select Script from the Object type drop-down list.

    4. In the Script Editor box, type Line + 1; to insert a counter in the LIN segment.

    The Line variable is a Form Engine script variable. It contains the pattern's line number on which the rearrange is placed. The Line variable starts with the line number set to 0 (zero).

    Once you are done, click Ok.

    1. Preview your final document by clicking the Preview button on the toolbar.

    04.-EDI-Output
    82.54 KB


    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.