V175 Data Bridge SO Updates  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

V175 Data Bridge SO Updates

Postby 2can2 » Wed Jun 28, 2017 1:07 pm

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.
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: V175 Data Bridge SO Updates

Postby 2can2 » Wed Jun 28, 2017 1:08 pm

Sorry didn't mention I am using the standard plugin to import SO's.
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: V175 Data Bridge SO Updates

Postby Mike.Sheen » Wed Jun 28, 2017 7:42 pm

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
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: V175 Data Bridge SO Updates

Postby 2can2 » Thu Jun 29, 2017 10:14 am

It is using an XML file. I did try with the LineNo syntax but obviously it had no effect. Thanks in advance.
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: V175 Data Bridge SO Updates

Postby Mike.Sheen » Fri Jun 30, 2017 11:11 pm

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?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: V175 Data Bridge SO Updates

Postby 2can2 » Tue Jul 04, 2017 11:18 am

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.
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: V175 Data Bridge SO Updates

Postby 2can2 » Wed Jul 26, 2017 10:22 am

Hi, Any joy on this. Client is pressing me. Thanks.
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: V175 Data Bridge SO Updates

Postby Mike.Sheen » Wed Jul 26, 2017 10:37 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: V175 Data Bridge SO Updates  Topic is solved

Postby Mike.Sheen » Sun Jul 30, 2017 11:59 am

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()
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: V175 Data Bridge SO Updates

Postby 2can2 » Wed Aug 02, 2017 10:39 am

Hi Mike, thanks for the updated code. There is an issue that we are now working through on case 1345. Cheers
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 7 guests

cron