Search Like Sales order  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Search Like Sales order

Postby SBarnes » Wed Feb 03, 2021 11:04 am

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?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Search Like Sales order  Topic is solved

Postby nsbandara » Wed Feb 03, 2021 2:57 pm

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   

User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Search Like Sales order

Postby SBarnes » Wed Feb 03, 2021 3:18 pm

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?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Search Like Sales order

Postby SBarnes » Thu Feb 04, 2021 6:10 pm

I've been able to get this to work myself.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Search Like Sales order

Postby DannyC » Mon May 31, 2021 4:49 pm

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?
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Search Like Sales order

Postby nsbandara » Mon May 31, 2021 6:07 pm

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);
}
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Search Like Sales order

Postby DannyC » Tue Jun 01, 2021 9:58 am

Sure I can iterate through the results, but how do I return all results back to the warehouse transfer grid?
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Search Like Sales order

Postby SBarnes » Tue Jun 01, 2021 11:39 am

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??
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Search Like Sales order

Postby DannyC » Wed Jun 02, 2021 9:56 am

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.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Search Like Sales order

Postby SBarnes » Wed Jun 02, 2021 10:07 am

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.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron