Page 1 of 1

auto-complete fields

PostPosted: Thu Feb 11, 2010 12:14 pm
by butchseaman
I have two tables I am working with.
client_info
policy_information

I select a record in client_info and it list the associated records when in detail view.
I select one of the associated records and it gives me associated information.

What I want is to have a name field auto populate from the client_info in the associated record when viewing.

Not sure if this makes sense ...

not sure how to get this done....

Thanks in advance for your advice

Re: auto-complete fields

PostPosted: Thu Feb 11, 2010 3:12 pm
by shannah
There are a few ways to accomplish this.

1. Use a vocabulary on the client_info_id field so that it is displayed as something more human readable in the interface when it is displayed.

2. Use the __sql__ directive to "graft" some fields onto the end of the associated_records table.
e.g.
in the fields.ini file for the associated_records table.
Code: Select all
__sql__ = "select a.*, c.client_name from associated_records a left join client_info c on a.client_info_id=c.client_info_id"



3. Implement the fieldname__display() for a field to be more descriptive (loading info about the client_info from the database).

-Steve