search: perform, select, put in another table

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

search: perform, select, put in another table

Postby cuoredisardegna@tiscali.i » Sat Apr 17, 2004 7:34 am

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.

Tanks in advance
Gianni Pinna
cuoredisardegna@tiscali.it
cuoredisardegna@tiscali.i
 
Posts: 151
Joined: Sun Feb 29, 2004 10:35 pm
Location: Sassari

Re: search: perform, select, put in another table

Postby Riccardino » Sat Apr 17, 2004 9:31 am

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

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 :D
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

search: perform, select, put in another table

Postby cuoredisardegna@tiscali.i » Sat Apr 17, 2004 12:29 pm

Buon lavoro
Dear Riccardino,

i received your prompt reply.
I am starting in working with docylity to Yours specifications.
I hope that you will find in your problems persons kind with you as you have wonted be with me.

Tanks with best regards

Gianni Pinna
cuoredisardegna@tiscali.i
 
Posts: 151
Joined: Sun Feb 29, 2004 10:35 pm
Location: Sassari


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests

cron