[Q] How to automatically compute a self relationship key

  • Follow


Consider the following using FMP Dev 6.04 and Mac OS X 10.2.6 :

A DB with Names, addresses, etc. I want to automate the linking together 
of groups of people by  common keys. Here are two examples of what I 
mean.

(0) Family members. There is a self-relationship on a field Family ID.
The following script computes a unique key:

If("0=Length(Family ID"))
  Insert Calculated Result [Select, "Family ID",
           Name Last & " " & Today & " " & Status(CurrentTime)]
endif


What I want to do is compute this key for the first family member that 
is entered into the DB but use the same key for all subsequently added 
members thus linking them together. 

The question boils down to how to do this.

For example is there a capability to execute a script when exiting a 
field? That way I could determine if this is the first time that this 
surname has been entered. 

If not I could calculate the key. If it has already been entered I could 
do a scripted find on the surname and interact with the user to select 
any one of the other family memembrs with the same surname.

But what about those that do not have the same surname?

(1) The DB has sub-groups of people who are either teaching or helping 
in various study groups (classes) or they are students in those classes.

I want to be able to link together all the people involved in a given 
study group (class). So selecting the Class ID will pull up all the 
teachers, helpers, and students for that class.

This is really the same problem as (0) but using a different 
relationship.

Surely this must have been solved before? 

In fact this is for Sunday School attendance at the church I belong to 
and ifthere was a package that did this I'd use that. I looked but 
didn't find anything so far.

So please share your advice and suggestions.

Thanks and 

respect...

Peter
0
Reply Peter 7/28/2003 4:09:38 PM

Hello Peter,

Are you currently trying to achieve this with one file?  Although your task
may seem simple it does require a more complicated relational model to be
succesful and some rather extensive development (depending on your skill
level).  At a minumum you would require three files (separate databases).
One for people, one for groups and one for classes. I may have an example of
something similar if you think it would be helpful.

best regards,

PL

"Peter Teeson" <pteesonNOT@rogers.com> wrote in message
news:pteesonNOT-CDD98E.12093628072003@nntp.bloor.is.net.cable.rogers.com...
> Consider the following using FMP Dev 6.04 and Mac OS X 10.2.6 :
>
> A DB with Names, addresses, etc. I want to automate the linking together
> of groups of people by  common keys. Here are two examples of what I
> mean.
>
> (0) Family members. There is a self-relationship on a field Family ID.
> The following script computes a unique key:
>
> If("0=Length(Family ID"))
>   Insert Calculated Result [Select, "Family ID",
>            Name Last & " " & Today & " " & Status(CurrentTime)]
> endif
>
>
> What I want to do is compute this key for the first family member that
> is entered into the DB but use the same key for all subsequently added
> members thus linking them together.
>
> The question boils down to how to do this.
>
> For example is there a capability to execute a script when exiting a
> field? That way I could determine if this is the first time that this
> surname has been entered.
>
> If not I could calculate the key. If it has already been entered I could
> do a scripted find on the surname and interact with the user to select
> any one of the other family memembrs with the same surname.
>
> But what about those that do not have the same surname?
>
> (1) The DB has sub-groups of people who are either teaching or helping
> in various study groups (classes) or they are students in those classes.
>
> I want to be able to link together all the people involved in a given
> study group (class). So selecting the Class ID will pull up all the
> teachers, helpers, and students for that class.
>
> This is really the same problem as (0) but using a different
> relationship.
>
> Surely this must have been solved before?
>
> In fact this is for Sunday School attendance at the church I belong to
> and ifthere was a package that did this I'd use that. I looked but
> didn't find anything so far.
>
> So please share your advice and suggestions.
>
> Thanks and
>
> respect...
>
> Peter


0
Reply Pierre 7/28/2003 5:36:30 PM


1 Replies
145 Views

(page loaded in 0.029 seconds)

Similiar Articles:







7/11/2012 10:59:57 PM


Reply: