Hi Doug,
We've not done this specific conversion before, but have done others.
There are a couple of ways to do this - you can come up with an XSLT which converts the incoming XML to the Jiwa Sales Order XML. I've done this before with a Jiwa PO to a Jiwa SO, and whilst it was simple enough, it was a laborious process and learning XSLT is probably not something you want to do.
The way I'd do it is to get hold of the XSD for that document (the header suggests there is one available) - and use the Microsoft xsd.exe tool or similar to generate the class files to code. Then, in a plugin you can read the XML into objects and map by doing something like his :
- Code: Select all
// Read the PO from XML file
XmlSerializer serializer = new XmlSerializer(typeof(enece.StandardBusinessDocument));
StreamReader reader = new StreamReader("C:\\Users\\mikes\\Downloads\\Purchase Order Change_51784753.xml");
enece.StandardBusinessDocument purchaseOrder = new enece.StandardBusinessDocument();
purchaseOrder = (enece.StandardBusinessDocument)serializer.Deserialize(reader);
reader.Close();
// Create a new sales order
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesOrder = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder>(null);
salesOrder.CreateNew(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, "1001", false);
// Put the PO fields into our sales order
salesOrder.OrderNo = purchaseOrder.message.transaction.command.documentCommand.documentCommandOperand.order.orderIdentification.orderIdentificationuniqueCreatorIdentification;
// map rest of fields here
// Save the sales order
salesOrder.Save();
We could do this for you - open a case with our support department and we can get it quoted for you.
Mike