Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding and displaying realetd fields

Status
Not open for further replies.

dongle

IS-IT--Management
May 31, 2001
78
GB
Filemaker Por v4
I have two data bases which I shall call PARENT and CHILD
The children belonging to each parent are shown in a portal.
Sometimes I wish to see only the female children belonong to each parent.
I have a field marked gender in each child record which I can use to do a find however I cannot work out a way of setting up the portal just to show the results of this search. It always shows both male and female children in the portal.
 
I see no one responded to your post.

I thought I'd pass on information that would help you or show you why this can't be done like you are trying to do it.

A portal is based on the relationship you create to display the data. Likewise the field you place in the portal is based on the same relationship. In the parent file, your relationship is likely based on the parent id and this parent id is carried forward to each child record in your child file. Since the relationship is the parent id, you will always have all files show up that are true to the relationship. FM does not let you do a find from a parent file, through a portal. The relationship filters the records for you. Logic then says, change the relation id and you can change the results in the portal. This could be done with a script, but writing this is quite complicated.

First your relationship would have to be based on a relationship id field, not the actual parent id. The script would go to the relationship field and do a setfield(relationhsip id, parent ID (+ a sort factor, combined not added, 11 for all, 22 for male, 33 for female, for example.) If your parent record id was 104 for example. So the relationship id becomes 10411 for all, 10422 for male and 10433 for female. Now the hard part, your script needs to call a script in the related child file and perform a similar script in the child relationship file. This script will have to go to the first related child record and then loop through each of the records, calculating and doing a setfield the same as above if the child is male or female or if you want all files to show.

Give me some feed back if you want to persue a script.

I hope this helps!

Marty
 
Set up some calculated fields in your files -
PARENT. GenderF = Serial & "F"
GenderM = Serial & "M"
CHILD. GenderCh = ParentSerial & Gender
Set up links from PARENT to CHILD GenderF to GenderCh and GenderM to GenderCh.
If that doesn't meet your requirements, post again. There are some 'conditional portal' techniques around.

Cheers,
Paul J.
 
portal--lookups (or unstored calculation=related_field)
can do a simple search...scripted or not
all the best
 
Thanks to you all. I am now doing an Access version - mainly because the user will find Access support is easier to find locally than Filemaker support. (If I get run over by a bus).
I haven't yet found out if this problem occurs in Access and if so how to overcome it.

I do appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top