Page 1 of 1

Purchase Order - Supplier PartNo

PostPosted: Thu Jun 02, 2016 1:57 pm
by Ernst
Have put in the code below, to Unlock the Supplier Partno. It works fine and the supplier partno becomes modifiable. But any changes you make just get ignored.?
Even if you change the supplierpartno field on the PO lines, it just continues to show the supplier partno from inventory.
This is JIWA7.0.157, and the code is vb.net., Not sure if this is a JIWA bug, or I need some more code.


Private Sub PurchaseOrder_ReadEnd(sender As Object, e As System.EventArgs)
Dim purchaseOrder As JiwaPurchaseOrders.PurchaseOrder = sender
Dim purchaseOrderForm As JiwaPurchaseOrdersUI.MainForm = purchaseOrder.Client

With purchaseOrderForm.LinesJiwaGrid
For row As Integer = 0 To .ActiveSheet.RowCount - 1
If .GridText("RecID", Row).ToString.Trim.Length > 0 Then
.LockColumn(False, "SuppPartno", row)
End If
Next
End With
End Sub

Private Sub PurchaseOrder_Line_Added(item As JiwaPurchaseOrders.Line)
'
Dim purchaseOrderForm As JiwaPurchaseOrdersUI.MainForm = item.Lines.PurchaseOrder.Client

With purchaseOrderForm.LinesJiwaGrid
For row As Integer = 0 To .ActiveSheet.RowCount - 1
If .GridText("RecID", Row).ToString.Trim = item.RecID Then
.LockColumn(False, "SuppPartno", row)
Exit For
End If
Next
End With

Re: Purchase Order - Supplier PartNo  Topic is solved

PostPosted: Fri Jun 03, 2016 11:03 pm
by Mike.Sheen
The business logic for the purchase order makes no attempt to update the SuppPartNo column of PO_Lines, and this is why despite you unlocking the field it reverts back. The form does take changes for that column and pass it on to the business logic, but it's simply not written away.

I don't know why this is, so I've logged bug DEV-5011 to look at this.

In the meantime, a plugin can perform an update query to do this as a work around. You will need to hook into the SaveEnding event of the PO and iterate through the purchase order lines and issue an update query on PO_Lines to update the column value.

Re: Purchase Order - Supplier PartNo

PostPosted: Wed Mar 08, 2017 12:14 pm
by Ernst
Just looked on 7.0.175, still not working

Re: Purchase Order - Supplier PartNo

PostPosted: Wed Mar 08, 2017 5:05 pm
by Mike.Sheen
Hi Ernst,

I've updated my previous post so the link to the issue DEV-5011 is correct.

This is now fixed will be in the next development build.

Mike