Page 1 of 1
V175 Data Bridge SO Updates

Posted:
Wed Jun 28, 2017 1:07 pm
by 2can2
Hi, Is there any way that we can import NEW SO lines to an Existing SO at a specific position? If I have a SO with 5 lines I would like to insert a comment line after SO Line1 and then add a NEW SO line after this Comment line - now this would be line 3? LineNo seems to be ignored. The client doesn't use stock control all items are Non physical. Thanks.
Re: V175 Data Bridge SO Updates

Posted:
Wed Jun 28, 2017 1:08 pm
by 2can2
Sorry didn't mention I am using the standard plugin to import SO's.
Re: V175 Data Bridge SO Updates

Posted:
Wed Jun 28, 2017 7:42 pm
by Mike.Sheen
2can2 wrote:Hi, Is there any way that we can import NEW SO lines to an Existing SO at a specific position? If I have a SO with 5 lines I would like to insert a comment line after SO Line1 and then add a NEW SO line after this Comment line - now this would be line 3? LineNo seems to be ignored. The client doesn't use stock control all items are Non physical. Thanks.
Hi Doug,
Was this an XML file or a CSV file you are importing?
It seems we never attempt to set the LineNo / LineNum property when deserialising XML - so in order to do that just a little code is needed in that plugin to set the LineNo property after deserialising but before saving.
Let me know if it's CSV or XML and I'll put something together for you.
Mike
Re: V175 Data Bridge SO Updates

Posted:
Thu Jun 29, 2017 10:14 am
by 2can2
It is using an XML file. I did try with the LineNo syntax but obviously it had no effect. Thanks in advance.
Re: V175 Data Bridge SO Updates

Posted:
Fri Jun 30, 2017 11:11 pm
by Mike.Sheen
2can2 wrote:It is using an XML file. I did try with the LineNo syntax but obviously it had no effect. Thanks in advance.
Thanks - just so I'm clear before I sink time into this - you're using the "File Watcher" plugin and the aspect which monitors the "ProgramData\Jiwa Financials\Jiwa 7\Import\XML" folder and not the "ProgramData\Jiwa Financials\Jiwa 7\Import\XML Queue" folder?
Re: V175 Data Bridge SO Updates

Posted:
Tue Jul 04, 2017 11:18 am
by 2can2
Hi, This is the JMS site that you modified the 'Jiwa File watcher' and 'SO Autoprint' plugins recently for me because of timing issues on updates.
The File Watcher looks for the XML files on "C:\Jiwa\DataBridge\" folder and I believe you modified the plugin to import SO's directly?
I still have the standard 'Jiwa Import Queue' enabled but I don't think it is being used.
Re: V175 Data Bridge SO Updates

Posted:
Wed Jul 26, 2017 10:22 am
by 2can2
Hi, Any joy on this. Client is pressing me. Thanks.
Re: V175 Data Bridge SO Updates

Posted:
Wed Jul 26, 2017 10:37 am
by Mike.Sheen
I can't really give you here, on forums a modified version of your customers already modified File Watcher plugin - it's not appropriate to do that.
I can modify the standard one - and that's what I intend to do - but I have not had time to do this yet.
Re: V175 Data Bridge SO Updates 

Posted:
Sun Jul 30, 2017 11:59 am
by Mike.Sheen
Hi Doug,
I have remoted into your customers site and implemented the ability to set the ItemNo on sales order lines when importing from XML file. The changes will not take effect until the JiwaPluginScheduler service is restarted - I wanted the change to not be in effect until you were aware so you can perform necessary checks. When you're ready, restart the service and monitor the log and imported orders to ensure it's working as you expect.
For future changes like this, it's more appropriate to make a service issue and deal with it that way, rather than here on forums.
For others wanting to do the same when importing XML sales orders, the code is as follows:
- Code: Select all
salesOrder.Deserialise(xmlText)
' ***********************************************************************************************************************************
' Set the ItemNo - as the Deserialise method does not attempt to do this, we need to read in the XML string to a new XML.SalesOrder
' then parse that and match against the salesOrder object the line and set the ItemNo
' Note that we may be importing a complete order, or a partial update - so we are not guaranteed there will be a 1:1 match in the lines
' Also note comment lines may exist
Dim XMLSalesOrder As JiwaSales.SalesOrder.XML.SalesOrder = Nothing
Dim xmlSerializer As New System.Xml.Serialization.XmlSerializer(GetType(JiwaSales.SalesOrder.XML.SalesOrder))
Using stringReader As New System.IO.StringReader(xmlText)
XMLSalesOrder = xmlSerializer.Deserialize(stringReader)
stringReader.Close()
End Using
If XMLSalesOrder IsNot Nothing Then
For Each XMLSalesOrderLine As JiwaSales.SalesOrder.XML.Line In XMLSalesOrder.Lines
If XMLSalesOrderLine.ItemNoSpecified AndAlso XMLSalesOrderLine.ItemNo > 0 Then
For Each salesOrderLine As JiwaSales.SalesOrder.SalesOrderLine In salesOrder.SalesOrderLines
If ((XMLSalesOrderLine.CommentLine AndAlso salesOrderLine.CommentLine AndAlso XMLSalesOrderLine.CommentText = salesOrderLine.CommentText) _
OrElse _
(XMLSalesOrderLine.CommentLine = False AndAlso salesOrderLine.CommentLine = False AndAlso XMLSalesOrderLine.PartNo.ToLower.Trim = salesOrderLine.PartNo.ToLower.Trim)) Then
salesOrderLine.ItemNo = XMLSalesOrderLine.ItemNo
Exit For
End If
Next
End If
Next
End If
' ***********************************************************************************************************************************
salesOrder.Save()
Re: V175 Data Bridge SO Updates

Posted:
Wed Aug 02, 2017 10:39 am
by 2can2
Hi Mike, thanks for the updated code. There is an issue that we are now working through on case 1345. Cheers