Intercepting sales order XML Import

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

Intercepting sales order XML Import

Postby DannyC » Wed Aug 12, 2026 4:16 pm

This is the XML code block from the standard File Watcher plugin that imports sales orders.
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.
User avatar
DannyC
Senpai
Senpai
 
Posts: 745
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 99 guests