Jump to content

Filter Relationship by type of child record?


This topic is 976 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello Forum.  Seems like I'm getting back into FileMaker.  But I'm pretty rusty and forgot many things.

I have the following relationships (probably wrong for what I am trying to accomplish):

pic.png.f123c4c45e3490c4ea6ca22f42e8bcae.png

The 'DataEntry' TO's are just for presentation/ U/I for iPhone, and the 'Gallons_VL' is used for a condtional value list.  The 3 Main TO's are JOBS, TIME & GALLONS.

A JOBS record can create 2 different types of child records-TIME or GALLONS, never both for 1 specific JOBS record.  TIME and GALLONS Layouts are each based on JOBS with their own portals.

The problem:
Say I have 8 JOBS records, 5 with TIME child records and 3 with GALLONS child record.  Regardless of which JOBS layout I'm on (the one with the TIME portal or GALLONS portal), all 8 records obviously show up.

Hoping for:

What I would like to have happen would be when I step thru the JOBS records on the JOBS w/TIME portal records layout, only show those child records, and the same when on the JOBS w/GALLONS.

Things I've tried:

1.  One TO for JOBS to TIME and one TO for JOBS to GALLONS-didn't work unless I didn't set it up right.

2.  Putting a 'Type' field in JOBS and TIME, and JOBS and GALLONS, and trying to match on that.

3.  I could just do a Find for 'Type' on record load/or creation...seems clunk'ish'.

4.  Put the Time Portal on one Tab Panel, Gallons Portal on another Tab Panel, on the same layout and hide/show proper tab panel.

5.  Or do I need one TO group like above, and another for TO group connected by 'Type' and use that for presentation.

Any guidance or pointers would be greatly appreciated.

Thanks

Steve

Link to comment
Share on other sites

It's hard to advise without knowing what these entities represent in real life. Assuming that the basic structure is correct - i.e. that the two types of JOBS are sufficiently similar to belong in the same table, and that TIME and GALLONS are sufficiently different to warrant separate tables, I would say you could either select the correct layout for each record by using the OnRecordLoad script trigger, or use a single layout and show the relevant parts for each type, as per your suggestion #4.

I don't see why you would want to browse only records of one type - but if you did, you could do so by selecting the layout and then using the OnLayoutEnter script trigger to create a found set of records with the corresponding type. Or select the type by a button that calls a script that does both.

Note that TO's do not automatically filter records. A layout associated with a TO can show any record in the TO's base table - and will do so unless you either perform a find or use GTRR.

 

 

 

Edited by comment
Link to comment
Share on other sites

This topic is 976 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.