AnsweredAssumed Answered

XLM XSLT exporting Purchase Order for EDI

Question asked by Gingernut on Jul 20, 2017
Latest reply on Jul 21, 2017 by beverly

I have been asked to create an XLM file in a specific format for Purchase orders to be sent to suppliers.

 

I have read about EDI XLM XSLT and have a general idea of how it all fits together so now need to knuckle down and make it happen

 

I will need some new fields in my P Order which is the easy bit -and I know I can change the field names etc in an XSLT and make it in the format that is required - (I aim to try and work it out myself as think it will serve me well for other uses) 

 

What I am struggling with (probably blindingly obvious) is this.

 

I will be exporting from the P Order Line items and Purchase Oder tables but I only want the P Order header details once and the P Order lines will be the Product Lines in the suppliers XML file.

 

Do I have to create a variable and set each Purchase Order Item and then add the lines by looping or can the XSLT strip out the superfluous data?

 

Would SQL an alternative to this by using DISTINCT for the what are effectively header details IE Purchase Order and then the detail for the Lines.

 

Any help much appreciated. Thank you.

 

 

My end result needs to be something like this

<?xml version="1.0" encoding="utf-8"?>

<root>

<header>

<version>1.0</version>

<loginid></loginid>

<password></password>

<company></company>

</header>

<orders>

<order>

<ordernumber>363</ordernumber>

<name>Ealing Camera Studio</name>

<addressline1>243 The Broadway</addressline1>

<addressline2>Ealing</addressline2>

<towncity>London</towncity>

<county></county>

<postcode>W5 8UY</postcode>

<country>UK</country>

<contactname></contactname>

<contactphone> 020 8745 2514</contactphone>

<jobnumber>J2142/TD1</jobnumber>

<serialnumber>GH34554454 (A1234)</serialnumber>

<machinelocation>2nd Floor</machinelocation>

<instructions>Please ask Anne to sign</instructions>

<customerref>CustPOnum</customerref>

<orderline>

<orderlinenumber>363</orderlinenumber>

<sku>34010351</sku>

<qty>1</qty>

<price>19.00</price>

<productcode>TONERLI</productcode>

<description>Lime Toner</description>

</orderline>

<orderline>

<orderlinenumber>363</orderlinenumber>

<sku>30010151</sku>

<qty>1</qty>

<price>20.00</price>

<productcode>30010151</productcode>

<description>Black Toner </description>

</orderline>

</order>

</orders>

</root>

Outcomes