Hi, I have created a custom plugin for an Inventory search but keep getting an error 'Argument length must be equal or greater than zero' - I can't see anything wrong with the code and I have similar variations running on different sites. Can you tell me where my code is wrong? Custom code below and plugin attached.
Private Sub Search_Showing(sender As Object, e As System.EventArgs)
With JiwaApplication.Manager.Instance.Search
If .CurrentSearchMode = JiwaApplication.JiwaSearch.clsSearch.SearchModes.jswInventory Then
' Inv Desc Search widen desc, partno columns DH 120417
Dim AOption As New JiwaApplication.JiwaSearch.SearchOption
With AOption
.Title = "*RR Desc."
.SQLStr = "SELECT IN_Main.InventoryID, IN_Main.Description, IN_Main.PartNo, " & _
"Cat1.Description, Cat2.Description, Cat3.Description, IN_Classification.Description, IN_Main.DefaultPrice " & _
"FROM IN_Main INNER JOIN IN_Category1 AS Cat1 ON (IN_Main.Catagory1ID = Cat1.Category1ID) " & _
"Inner JOIN IN_Category2 AS Cat2 ON (IN_Main.Catagory2ID = Cat2.Category2ID) " & _
"Inner JOIN IN_Category3 AS Cat3 ON (IN_Main.Catagory3ID = Cat3.Category3ID) " & _
"Inner JOIN IN_Classification ON (IN_Main.ClassificationID = IN_Classification.InventoryClassificationID) " & _
"WHERE IN_Main.Status <> 2 "
.OrderBy = "ORDER BY IN_Main.Description "
.AddColumn("InventoryID", vbString, "", 0, 1)
.AddColumn("Description", vbString, "", 36, 2)
.AddColumn("PartNo", vbString, "", 15, 3)
.AddColumn("Cat L1", vbString, "", 10, 4)
.AddColumn("Cat L2", vbString, "", 10, 5)
.AddColumn("Cat L3", vbString, "", 10, 6)
.AddColumn("Classification", vbString, "", 10, 7)
.AddColumn("Price", vbDecimal, "", 6, 8)
.AddColumn("DecimalPlaces", vbString, "", 0, 9)
End With
.Options.Add(AOption)
End If
End With
End Sub