XML Sales Order Export  Topic is solved

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

XML Sales Order Export

Postby Sunny » Thu May 14, 2015 11:15 am

Hi,
We need to customise XML Export to a customer as we move him to V7. The XML is in our standard format as we would export from the utilities tab/ XML Export command button. However, we would not want the Save As dialogue box, instead it should save to a predesigned path and just confirm the XML has been exported.
This is the current breakout in 6.5.13

If MenuIndex = 0 Then
If SalesOrderObject.SalesOrderCustomSettings("Auth").SettingContents = "1" Then
If SalesOrderObject.GenerateXML(XML, True, "\\srv-SQL2\lsi2\interfaces\Import\" & SalesOrderObject.InvoiceNo & ".xml") = 0 Then
MsgBox SalesOrderObject.ErrorString
Else
MsgBox "\\srv-SQL2\lsi2\interfaces\Import\" & SalesOrderObject.InvoiceNo & ".xml saved"
End If
Else
MsgBox "This sales order has Not been authorised For release"
End If
ElseIf MenuIndex= 1 Then
eMailbyFaxNumber SalesOrderObject,MDIParentObject,FormObject
End If
End Sub

This can be triggered by a command button placed on the ribbon on the Utilities tab
Can you assist us in this please?
Thanks!
Sunny
Occasional Contributor
Occasional Contributor
 
Posts: 23
Joined: Mon May 11, 2015 1:38 pm
Topics Solved: 2

Re: XML Sales Order Export  Topic is solved

Postby Scott.Pearce » Thu May 14, 2015 12:23 pm

You should be able to write a plugin to intercept the ribbon tool click for the sales order form. Do this by adding your handler in SetupBeforeHandlers (so your handler gets executed before the standard toolclick handler). In your handler, if the tool.key = "ID_RecordUtilitiesExportToXML", then do *your* xml export, and then throw a jiwa ClientCancelledException exception so the real xml export doesn't occur:

Code: Select all
Dim xmlString As String = ""
salesOrderForm.SalesOrder.Serialise(xmlString)
Dim fileName As String = "e:\MyXMLFile.xml"
My.Computer.FileSystem.WriteAllText(fileName, xmlString, True)
MsgBox(fileName + " exported.")
Throw New JiwaApplication.Exceptions.ClientCancelledException
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: XML Sales Order Export

Postby Sunny » Fri May 15, 2015 11:35 am

Thanks Scott.
Sunny
Sunny
Occasional Contributor
Occasional Contributor
 
Posts: 23
Joined: Mon May 11, 2015 1:38 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests