by 2can2 » Thu Jan 21, 2016 9:25 pm
Hi Mike, I haven't had time to figure out how you sample Functions work so used the base code I have used for other custom searches in V7.
It works fine except I don't know how to restrict the display to ONLY the IN_SOH records matching the InventoryID we have already selected.
This is in Stock Transfers From Part No, Enter Part No which is serial and the Search window pops up ? Can you help please - code below:
Private Sub Search_Showing(sender As Object, e As System.EventArgs)
With JiwaApplication.Manager.Instance.Search
'' Msgbox(.currentsearchmode)
If .CurrentSearchMode = JiwaApplication.JiwaSearch.clsSearch.SearchModes.jswStockOnHand Then
'' Reference the Search Module!!!!
Dim AOption As New JiwaApplication.JiwaSearch.SearchOption
With AOption
.Title = "Straw ID ,Tank"
.SQLStr = "SELECT IN_SOH.LinkID, IN_Soh.InventoryID, SerialNo, BinLocationDesc, DateIn, QuantityLeft, QuantityIn " &
"FROM IN_Main JOIN IN_SOH On IN_Main.InventoryID = IN_SOH.InventoryID " & _
"WHERE (IN_SOH.InventoryID = JiwaApplication.Manager.Instance.Database.Current.InventoryID) " &
" And (QuantityLeft <> 0) And (IN_SOH.IN_LogicalID = 'ZZZZZZZZZZ0000000000') "
'' And (IN_SOH.InventoryID = IN_Main.InventoryID)
.OrderBy = "ORDER BY IN_SOH.SerialNo"
.AddColumn ("LinkId", vbString, "", 0, 0)
.AddColumn ("InventoryID", vbString, "", 0, 1)
.AddColumn ("Serial No", vbstring, "", 15, 2)
.AddColumn ("Tank ID", vbstring, "", 15, 3)
.AddColumn ("Date In", vbDate, "", 15,4)
.AddColumn ("Qty Left", vbInteger, "", 6, 5)
.AddColumn ("Qty In", vbInteger, "", 6, 6)
End With
.Options.Add(AOption)
End If
End With
End Sub
Cheers