XML PO Import  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

XML PO Import

Postby 2can2 » Thu May 07, 2015 1:01 pm

Hi, Have you done a conversion for 3rd party PO's to our import format to use in the data bridge. I am looking for something similar to use for Masters PO's which are pretty verbose so if it has been done before it would be great. Sample attached.
Cheers
Attachments
Purchase Order Change_51784753.xml
Sample PO
(46.65 KiB) Downloaded 581 times
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: XML PO Import

Postby 2can2 » Thu May 07, 2015 1:03 pm

Sorry, should have mentioned their PO needs to import as our SO! Cheers
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: XML PO Import

Postby Mike.Sheen » Thu May 07, 2015 2:43 pm

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
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: XML PO Import

Postby 2can2 » Fri May 08, 2015 2:07 pm

Hi Mike, thanks for the reply. Masters apparently won't give out the layout info as they say it is in Webforms which is a standard product. I presume we would still need to go the custom route so will put in a support request. Cheers
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: XML PO Import  Topic is solved

Postby Mike.Sheen » Fri May 08, 2015 3:35 pm

2can2 wrote:Hi Mike, thanks for the reply. Masters apparently won't give out the layout info as they say it is in Webforms which is a standard product. I presume we would still need to go the custom route so will put in a support request. Cheers


I could be wrong, but from what I can tell that document sample you supplied is a GS1 standard.

EDIT: some more details which might be relevant: here.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron