Skip to main content

Subforms (XML, EDI, JSON) - Knowledgebase / Lasernet / Lasernet Training / Lasernet Form Editor 9 - Designing Forms - Formpipe Support Portal

Subforms (XML, EDI, JSON)

Authors list

You can also add subforms for such output formats as XML, EDI and JSON. The procedure is the same for all the mentioned output formats. In this exercise, you can learn how to add subforms to an output of the EDI format, and then edit it, as needed.

Exercise

Download and import the attached configuration called 38. Subforms (XML, EDI, JSON) in Lasernet Developer 9. Afterward, go to the Forms section and open the Sample form.

Once the Sample form is open, start adding subforms to the EDI output format. To this end, follow the steps listed below:

1. On the Developer toolbar, click the down-pointed arrow next to the Subform tool.

2. On the menu that appears, click Insert Global Subform….

3. After you have chosen a subform type, the mouse cursor changes its view. Click the EDI node (the root one) in the output to insert the subform.

4. As a result, the Subform dialog appears. To add a global subform, click the Add button.

5. In the subform properties dialog that appears, define the subform name (UNB). Once you are done, click the OK button.




6. Once you are back to the Subform dialog appears, click the Edit button.

7. In the editor that appears, first switch to the Template tab, and then insert the UNB+UNOA:2+FPSOFTWARE+HUBERGMBH+990802:1557+9908021557' string as it is shown in the picture below.



8. Afterwards, switch to the XML tab, and then expand the EDI node.

9. Change properties for every value node by defining to use the default value for each of them if no rearrange data is provided. To this end, double-click a node in the output to edit its properties, and then select the Use default value if no rearrange data is provided check box in the dialog that appears. Once you are done, click OK.

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


10. Once you are done, save the changes you have made by clicking the Save button and closing the editor.


11. Confirm inserting the global subform you have just added and edited by clicking the OK button in the Subform dialog. As a result, the subform is inserted into the output.

Repeat steps 1-11 to insert the following subforms by specifying the proposed string for them and editing the value node properties:


Global subform name

String

UNH

UNH+INVOIC0001+INVOIC:D:93A:UN'

BGM

BGM+380+9908001+9'

RFF

RFF+ON:O0010001'

DTM

DTM+4:19999715:102'

As a result, your output looks as follows:


12. Add once again a global subform called DTM. Start by repeating steps 1-3, but on step 4, do not click the Add button. In the Subform dialog, select the DTM subform from the list on the left panel instead.

13. Click the OK button to confirm inserting the subform.

14. As a result, the DTM subform is added to the output.



15. Add a fixed text (3) to the first value node of the DTM subform you have just inserted. To this end, use the Text tool. Once New Insert Text is shown as a node value, press F2, type 3, and then press F2 once again. As a result, the fixed text is added to the output.

16. Add a rearrange to the second value node of the DTM subform, by dragging the former from the input to the latter in the output.


17. Change the order of the subforms in the output. To this end, right-click the last DTM subform, and in the context menu that appears, first click Move Before, and then click RFF. As a result, you can see the DTM subform is now placed before the RFF subform.

Repeat steps 1-11 to insert the following subforms by specifying the proposed string for them and editing the value node properties:

Global subform name

String

NAD

NAD+SE+Formpipe Software+Lautrupvang 1+Ballerup+2750'

block

LIN+1+4711.001'

IMD+F+:::Description'

QTY+47:1:PCE'

MOA+66:750'

PRI+AAA:750'

UNS

UNS+S'

UNT

UNT+14+INVOIC0001'

UNZ

UNZ+1+9908021557'


As a result, your output looks as follows:


Repeat steps 12-14 to insert the NAD subform once again into the output. Once you are done, repeat step 15 to add a fixed text (BY) to the first value node of the NAD subform you have just inserted, and then repeat step 16 to add rearranges to the rest of nodes of the NAD subform by dragging the former from the input to the latter in the output (for rearranges, see the picture below). Afterward, repeat step 17 to change the order of the subforms in the output and move the NAD subform before the block node as shown in the picture below:


Continue with adding a pattern, rearranges and a script to the block subform. To this end, follow the steps listed below.

18. Drag the pattern added to the <Body_CustInvoiceTrans> element in the input to the block node in the output.


19. Using the Text tool, add a script (Line + 1;) to the value element available in the block node, as it is shown on the picture below.

20. Add rearranges to the nodes of the block subform by dragging them from the input to the required elements in the output (for rearranges, see the picture below).



21. Finish editing the value nodes of the subforms you have added by dragging the rearrange (InvoiceID) from the input to the value element of the UNZ subform in the output, as it is shown in the picture below.


22. Once you are done, 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