AnsweredAssumed Answered

Auto trigger relookup?

Question asked by user2147414 on Jun 3, 2018
Latest reply on Jun 4, 2018 by philmodjunk

Hi Guys.

 

I am creating two related tables in a one to many configuration.

Basically, what I am doing is like this:

(example is trading bananas for apples)

 

Table 1:

"Primary key";"Produce";"Fruit";"100";"Bananas";"Apples";"Timestamp";

 

Table 2:

"Foreign key";"Produce";"Fruit";"100";"Bananas";"Timestamp";

"Foreign key";"Produce";"Fruit";"-100";"Apples";"Timestamp";

 

Table 1 will receive data through typing,  calculations, data import, and bulk editing.

 

Table 2 needs to keep up with table 1.

 

I made a script that launched on record commit in layout showing table 1, but this won't work when editing records from table 1 through a portal.

 

The script would basically search through table 2, delete all keys with "Primary key" in "Foreign key", and recreate every single record, if the average of table 2::"Timestamp" was different from table 1::"Timestamp"

 

Though it works somewhat, it is painfully slow editing and adding records to Table 1, since it is searching through table 2 on over time.

 

Is it possible to set up anything like this through logic relations and lookups instead?

FMHelp FileMaker Pro 16 Help states that "Important  When a lookup is based on a multicriteria relationship, a lookup is activated each time a value is entered into any field that is involved in the relationship. The lookup is performed each time a value is entered into one of the required fields."

Can this be exploited to do what I need?

Outcomes