Page 1 of 2

Search Like Sales order

PostPosted: Wed Feb 03, 2021 11:04 am
by SBarnes
How can you make the search screen work like it does for sales orders where double clicking on the item puts it into a list at the bottom of the search screen?

Re: Search Like Sales order  Topic is solved

PostPosted: Wed Feb 03, 2021 2:57 pm
by nsbandara
To enable multiselect you have to set clsSearch object's UsePinBoard property to true . Please see example code segment below.

Code: Select all

    Public Sub Setup(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaApplicationManagerPlugin.Setup
      AddHandler Plugin.Manager.Search.Showing, AddressOf Search_Showing
    End Sub
      
   Private Sub Search_Showing(sender As Object, e As System.EventArgs)
      Dim searchObject As JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.clsSearch = DirectCast(sender, JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.clsSearch)
      searchObject.UsePinBoard = True   'Enable multiselect pin board
   End Sub   


Re: Search Like Sales order

PostPosted: Wed Feb 03, 2021 3:18 pm
by SBarnes
Thanks Nishantha

To continue this on and this may require Mike's or Scott's input just as there are now buttons to pin and unpin a given row how hard would it be to add buttons that did pin all and unpin all when the search screen is shown?

Re: Search Like Sales order

PostPosted: Thu Feb 04, 2021 6:10 pm
by SBarnes
I've been able to get this to work myself.

Re: Search Like Sales order

PostPosted: Mon May 31, 2021 4:49 pm
by DannyC
Just revisiting this so I can get the pinboard working when selecting items on a warehouse transfer.

I have the
Code: Select all
searchObject.UsePinBoard = True
but when I click the green Select & Close button, it only grabs the first item in the list.
What's the trick to get all selected items?

Re: Search Like Sales order

PostPosted: Mon May 31, 2021 6:07 pm
by nsbandara
You can iterate through search result collection to get all selected records.

Code: Select all
int searchResultCount = search.Results.Count;
for (int i = 1; i <= searchResultCount; i = checked(i + 1))
{
   var resultField = Conversions.ToString(search.Results[i].Fields[1].FieldValue);
}

Re: Search Like Sales order

PostPosted: Tue Jun 01, 2021 9:58 am
by DannyC
Sure I can iterate through the results, but how do I return all results back to the warehouse transfer grid?

Re: Search Like Sales order

PostPosted: Tue Jun 01, 2021 11:39 am
by SBarnes
In a warehouse transfer its in single search mode i.e. no pin board you would have override the button click code on the grid in a set up before handler and take over from Jiwa if that is what you are referring to??

Re: Search Like Sales order

PostPosted: Wed Jun 02, 2021 9:56 am
by DannyC
In a warehouse transfer its in single search mode i.e. no pin board

But
Code: Select all
searchObject.UsePinBoard = True
adds in the pinboard.
It works pretty good by dropping selected partnos to the lower pane, but when the green 'select & close' is clicked, only the top/first item is returned to the grid.

Re: Search Like Sales order

PostPosted: Wed Jun 02, 2021 10:07 am
by SBarnes
Yes but the Jiwa code that deals with the search screen when it comes down, which is in the grid button click, is only designed to deal with one record not multiples.

This is why you need to get in before Jiwa's event do your own processing to bring up the search screen, process the sections when it comes down into transfer lines and then client cancel exception to stop the Jiwa event from firing.