Page 1 of 1

XML Sales Order Export

PostPosted: Thu May 14, 2015 11:15 am
by Sunny
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!

Re: XML Sales Order Export  Topic is solved

PostPosted: Thu May 14, 2015 12:23 pm
by Scott.Pearce
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

Re: XML Sales Order Export

PostPosted: Fri May 15, 2015 11:35 am
by Sunny
Thanks Scott.
Sunny