cuoredisardegna@tiscali.i wrote:Could someone help me?
I have a Form[sales] using table sales.
In this Form i have field client.
The problem is that from this form
i want :
1.) Perform a %text% search in another
table named clients to wiew all clients
that match the text_search
2.) From the wiew select one client
to put it in the field client of Form
sales.
Ciao, Gianni
I use this method:
I create a form, based on table "customers", where I show all the search result in a list view (let's call it "elenco_clienti");
I put a global field on the header of this form (let's call it "cercaclienti")
I write a method like this:
- Code: Select all
controller.find()
company ="#%"+globals.cercaclienti+"%"
controller.search()
If you want to warn the user if your search fails, you can add:
- Code: Select all
if(controller.getMaxRecordIndex()== 0)
{
plugins.dialogs.showDialog('Ricerca','La ricerca effettuata non ha dato nessun risultato','OK')
controller.loadAllRecords()
}
Save the method, select the field "cercaclienti" in Developer Mode and set the option OnAction to execute the method you've just saved (this way, you can start the search simply hitting the ENTER key)
After that, move to your Sales form, place a tabpanel and choose to show records from "elenco_clienti"
This should work (unless I forgot something
If you want to see an excellent implementation of this technique, I suggest you take a look to:
http://www.mattstemplates.com/videos/RapidSearch.mov
Buon lavoro