I have been learning Filemaker via the Business Tracker solution/sample, I have a strong DB back ground and understand the tables and relations specific to my question.
What I would like to learn is how the location tabs are able to display data from up to 4 rows from table having a 1 to many relation without the use of a portal?
Layout name 'Company Detail (Contacts)' use table 'Company' and has 4 buttons on it bound to field location::namedisplay, this field is of type calc using a case function and to the best of my understanding will always be true.
TextColor( Case(UserSelectedLocation::UserName = Get(AccountName); TextStyleAdd ( Name ; Bold ); TextStyleAdd ( Name ; Plain )); RGB( 255; 255; 255))
The table UserSelectedLocation is linked into customer just like location is, this table only gets a single record created for user + company ID.
review:
1. company starts it all and is the default for the layout.
2. can have up to 4 locations for each company in the 'location' table.
3. the 'UserSelectedLocation' table will only have one record for each user that has viewed a company.
4. the 4 fields on the layout, linked to the same same field in the table are not in a portal.
When I duplicate this setup in a new db I just get the same first record in all my fields, I will have to admit that I did not create a matching UserSelectedLocation table and my calculation field was just pointing to the name field. I have done this short cut here as I tested in the business tracker app by deleting the record in UserSelectedLocation then switching back to the company detail view, I get the results I expect, the fields to edit the current location are blank as no record is there to pick a relation. The 3 field creating the tabs are still there and they match the 3 location records I have in the location table. Soon as I do something that cause the record to be recreated the location data returns.
Also in the business tracker solution the fields are not displayed unless there is a location record for it, i know they have to be setting the color but cannot find out where.
Thank You,
David