Skip to main content

EDI Output - Knowledgebase / Lasernet / Lasernet Training / Lasernet Form Editor 9 - XHTML, CSV, EDI, XML, JSON, PDF Form (filled) Output - Formpipe Support Portal

EDI Output

Authors list

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. Afterwards, go to the Forms section and open the Sample form.

Start by opening a template based on which you create the output. To this end, follow the steps listed below.

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, as well as edit their formats. To make adding patterns and rearranges to the input possible, switch to the XML tab in the output.

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

  • <InvoicingName>
  • <InvoicingAddress>
  • <InvoicingTown>
  • <InvoicingZip>
  • <InvoiceId>
  • <InvoiceDate>

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

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

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

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

8. Click the Add button.

9. 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.

10. 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.

11. Afterwards, 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 check box on the Output format tab available on the Formats tab of the Edit XML Rearrange dialog.

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

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

14. Select the Use default value if no rearrange data is provided check box. 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 03. CSV Output.

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

15. On the Developer tool bar, click Text.

16. When a pointer becomes a cross, click the node in the output as it is shown on the picture below:

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

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

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

20. 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 line number of the pattern on which the rearrange is placed. The Line variable starts with line number set to 0 (zero).

Once you are done, click Ok.

21. Preview your final document by click the Preview button on the toolbar.

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share