- Code: Select all
Private Sub XMLFileImport(ByVal FileName As String)
' Import the file using the import queue manager
SyncLock JiwaFinancials.Jiwa.JiwaApplication.Manager.CriticalSectionFlag
Dim importQueueManager As JiwaImportQManager.ImportQueueItemCollection = _plugin.Manager.BusinessLogicFactory.CreateBusinessLogic(Of JiwaImportQManager.ImportQueueItemCollection)(Nothing)
Dim queueItem As JiwaImportQManager.ImportQueueItem = _plugin.Manager.CollectionItemFactory.CreateCollectionItem(Of JiwaImportQManager.ImportQueueItem)
queueItem.TransformedXML = File.ReadAllText(FileName)
queueItem.Status = JiwaImportQManager.ImportQueueItem.ImportQueueItemStatuses.ReadyForImport
importQueueManager.Add(queueItem)
queueItem.Process()
If queueItem.Status = JiwaImportQManager.ImportQueueItem.ImportQueueItemStatuses.Failed Then
Throw New System.Exception(queueItem.ImportErrorMessage)
Else
XMLWatcher.LogToEventLog(String.Format("Imported XML from File '{0}'", FileName), System.Diagnostics.EventLogEntryType.SuccessAudit)
End If
End SyncLock
End Sub
Is it possible to intercept the XML before its written to Jiwa so we can adjust the sales order before it lands?
For example, lets say the debtor is 1002-Arthur Creams and we want to do something like add a comment line, maybe change the warehouse it lands in, add a special freight charge, or any other myriad of things that might be possible?
I've done it plenty of times using the CSV file watcher but funnily enough never the XML import.

