Re: foreign key question

[email protected]
Newsgroups gmane.comp.gnu.enterprise.general
Message-ID <[email protected]>
Hello.

El mar, jun 08, a las 22:38:20 Reinhard Mueller escribía:
> Am Die, den 08.06.2004 schrieb [email protected] um 1:17:
> > 
> > ...
> 
> ...
> 
> > The org record definition has a 'nick' field, but org record isn't a
> > 'user' record. What the user sees is a customer record, a provider
> > record, or a shipping operator one.
> > 
> > I'd like that, when the user is dealing with a customer record, the
> > 'nick' (org) field has the focus and (s)he strokes up/down keys,
> > navigates into customer records. I've solved the cuestion adding a
> > type field to org records but I wonder if there is a way to do
> > something like that without org table knowing about the class of record
> > that is actually linking to one of its ones.
> 
> I'm sorry but I can't follow you here.
> 

You have an org table that holds data from, say, customers and
providers and one of the fields is the name. Customer record has a field
that links to the correspondent org record, but you'd like org record
not to have a field saying if a customer record or a provider one is
actually linking to it.

You have a customer form with a master(org) / detail(customer) link so
the data gets sync and the user just see a whole virtual record. If you
navigate with the focus at name field, you will obtain org records
belonging to customers as well as providers.

I've solved the issue including a type field in org record an adding
the correspondent condition in org datasource, but I wondered if would
be a way for doing without the need of using a type field in org record.

> ...
>
> > > Using appserver, you could access the org of an employee as a field
> > > named "dept.org". You could filter by that, sort by that, or display
> > > it.
> > > You could even display a field named "dept.org.name", if the org_org
> > > table has a field "name".
> > 
> > This sounds like what I am looking for. How could this be done? By
> > mean of
> > a 'virtual' or mediated datasource from gnue-form point of view?

> No. By means of nothing. Just add a condition on the "dept.org" field of
> the employee datasource. You can play as if the employee table really
> had a field named "dept.org". Appserver will do all joins and everything
> automagically. No extra action required.

That's fine, and, in a wider sense, it means you can actually benefit
from appserver even programming nothing in appserver.

Thanks for your attention.
-- 
José Esteban
Granada - Spain
http://alcances.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.