Selecting parent value from a *LARGE* table.

A small puzzle…

When creating/updating a record which is the child of another table, it is sometimes necessary for the user to select the particular parent record. If there is a relatively small number of records to choose from (e.g. <<200) then a valuelist and dropdown usually suffices just fine :-)

But in the case where the parent table has a relatively large number of records (e.g. >>1000) this approach doen’t scale well (nor is it too user-friendly) :-(

Any suggestions on how to approach this?

Ideally I’d like to be able to call a method/whatever as a subroutine and have the user rummage around in a pop-up search screen, review the results, possibly re-do the search and finally either select a record and return or just cancel - in either case returning to the screen they started with. But I can’t see how to do this in Servoy (last time I tried, I could get a search screen in a pop-up but subsequent screens appeared in the main window).

Thanks,
Neale.

Neale, from daily practice my client wants to work with a short code for his relations.
They search on that code…

Also they use in the (what you call) ‘parent’ form quite often.

Marcel,

I think I understand what you are getting at (I too work with shortnames) and yes, the search form (same as you typically get via ctrl-F) is a good starting point.

But the issue I haven’t grasped is how to invoke this search as a subroutine and at the end of the search return to exactly where we started from (possibly a half-completed form for a new record, or an existing record being updated).

Any suggestions?

Thanks,
Neale.

Maybe this will help, use it from a search field with a dataprovider globals.findRecord:

var original = controller.duplicateFoundSet();

if (globals.findRecord)
{
globals.recordIndex = controller.recordIndex;

controller.find();
field_to_find = “#%” + globals.findRecord + “%”;

if (!controller.search() && globals.findRecord != “*”)
controller.loadRecords(original);
else
controller.loadAllRecords();
}
globals.findRecord = “”;

Now if you pick up (somewhere) on the globals.recordIndex and the original foundset you can go back the the form/record you were working on…

Hope this gives you a direction

Neale:
Any suggestions on how to approach this?

Ideally I’d like to be able to call a method/whatever as a subroutine and have the user rummage around in a pop-up search screen, review the results, possibly re-do the search and finally either select a record and return or just cancel - in either case returning to the screen they started with. But I can’t see how to do this in Servoy (last time I tried, I could get a search screen in a pop-up but subsequent screens appeared in the main window).

Thanks,
Neale.

Something I’m quite anxious for is the keyTyped() event. I hope they have it high in the priority list because it would allow you to control the contents of a list view (or list view within a tab panel) by simply typing into a field.

Example: I put a global field on my form named globals.typeFilter

I assign the onDataChanged event to the following…

var s = "#%" + globals.typeFilter + "%";

controller.find();

field_email = s;

controller.search();

elements.typeFilter.requestFocus(false);

What happens currently is you hit the return and the change in data in the global field triggers a new search (this can also be done with onAction).

The ideal would be, each key that was pressed while in the globals.typeFilter would trigger the method.

Hopefully we’ll get to use the two in conjunction. Using onDataChanged and keyTyped() or keyPressed() - whatever they call it - can be very powerful for filtering down a large set of records! But we’ll have to wait until that get that feature in. :(

Fortunately, the response time from the Servoy developers is nothing short of AMAZING!!! You don’t wait years for features, you wait months! Keep it up Servoy devs. YOU ROCK!!! :D