Custom Inventory Search in Bill of Materials  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Custom Inventory Search in Bill of Materials

Postby JimmySu1402 » Fri Jul 06, 2018 1:35 pm

All standard search does not have long enough description field.
I have created a custom search with Description length = 50

However, it does not seem to work with an error returned.

Your help will be much appreciated.
Attachments
Plugin ASAS Custom Search - Inventory BOM.xml
Here is the plug code
(30.21 KiB) Downloaded 72 times
Inventory Custom Search Error in Bill of Material.JPG
Here is the error
JimmySu1402
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Wed Sep 03, 2014 12:16 pm

Re: Custom Inventory Search in Bill of Materials

Postby Mike.Sheen » Fri Jul 06, 2018 11:40 pm

Moved from version 6 forum to version 7 forum.
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: Custom Inventory Search in Bill of Materials

Postby JimmySu1402 » Mon Jul 30, 2018 5:52 pm

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.
JimmySu1402
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Wed Sep 03, 2014 12:16 pm

Re: Custom Inventory Search in Bill of Materials  Topic is solved

Postby Mike.Sheen » Mon Jul 30, 2018 8:03 pm

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.
ASAS Custom Search.PNG


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
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


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 21 guests

cron