JimmySu1402 wrote:Hi Mike,
Would might test my plugin and let me know why i ran into issue when I am trying to use the custom search to add item to Bill of Material.
Hi Jimmy,
This is caused by that search wanting a column returned including the quantity decimal places for the item - it's a multi-select search allowing you to key in the quantity of each item selected - and in order to format that cell properly it needs to know a column to use for that.
Another search query has already defined column 10 as containing the quantity decimals, so you just need to return a column with index 10 containing a value.
Your fix is to change your Search_Showing method to be as follows:
- Code: Select all
Private Sub Search_Showing(sender As Object, e As System.EventArgs)
Dim search As JiwaApplication.JiwaSearch.clsSearch = sender
With search
If .CurrentSearchMode = JiwaApplication.JiwaSearch.clsSearch.SearchModes.jswInventory Then
' Add Inventory Custom Search to display
Dim AOption As New JiwaApplication.JiwaSearch.SearchOption
With AOption
.Title = "ASAS - CustomSearch"
.SQLStr = "SELECT IN_Main.InventoryID, IN_Main.PartNo, IN_Main.Description, CASE IN_Main.Status WHEN 0 THEN '0. Normal' WHEN 1 THEN '1. Discontinued' WHEN 2 THEN '2. Deleted' WHEN 3 THEN 'Slow Moving' WHEN 4 THEN '4. Obsoleted' END AS ItemStatus, IN_Main.DecimalPlaces " +
"FROM IN_Main "
.OrderBy = "ORDER BY PartNo"
.AddColumn("InventoryID", vbString, "", 0, 1)
.AddColumn("Part No", vbstring, "", 15, 2)
.AddColumn("Item Description", vbString, "", 50, 3)
.AddColumn("Item Status", vbstring, "", 9, 4)
.AddColumn("Decimals", VariantType.Integer, "", 0, 10)
End With
.Options.Add(AOption)
End If
End With
End Sub
Mike