AnsweredAssumed Answered

Relationship Not Found: ... target is not part of a related table.

Question asked by ruehli on Feb 8, 2018
Latest reply on Feb 22, 2018 by keywords

(FMP Advanced 16, FM Server 16)

 

I am getting the error "Relationship Not Found: This operation could not be completed because the target is not part of a related table." when I log on with a restricted account.

 

I cannot figure out how to debug this properly.

 

On login I have a script that checks the privilege set and in the case of the restricted user does

1. Install a restricted custom menu set

2. Disallows the formatting bar

3. Checks if I am in WebDirect (SystemPlatform = 4) and if so, hides and locks the toolbar

4. Goes to the layout "PortalTest", based on table "Company".

 

When loading this layout, I have another script that runs show all records and then calls a script that filters the found set as follows, and afterwards goes to the first record:

 

1. enter find mode (no pause)

2. sets to timestamp fields

3. sets a calculated field

4. constrains the found set

5. sorts the records

 

The layout shows the company name (field in table "Company"); the country via a relation between tables "Company" and "country"; and a portal to show records from the table "activities", which is related to "Company".

 

The calculated field starts a recursive custom function, and there are a couple of ExecuteSQL in it, but as far as I understand these should not result in a "relationship not found" error.

 

Also, when I switch to another table and then back to "PortalTest" I do not get the error (Not sure if this is due to the fact that FileMaker only throws it the first time?)

 

On the first load, however, I see that the scripts are not correctly executed, since the constraint is not happening: I see all records from Company, including the ones I tried to hide.

 

Subsequent loads do perform the scripts correctly, though; i.e. after switching away from "PortalTest" and back, I only see the records I intended to show.

 

What's weird is that the error started to appear after I changed buttons in the navigation area; apparently unrelated to any database or permission configuration that might be at play here...

 

Any help is appreciated.

Outcomes