AnsweredAssumed Answered

how to use the contents of a variable to populate LayoutTableName

Question asked by formergeek on Aug 22, 2017
Latest reply on Aug 22, 2017 by philmodjunk

I am fairly new to Filemaker (I have ver. 16) and I am putting together a script. The application has multiple tables, but I want to use the one script for what I want to do.  I am creating a log file that captures the user information and the activity of that user.  My problem is that I want to assemble the field name of the primary key and put it into a variable.  Then use the contents of the variable to get the data in the primary key.

 

This is what I mean:

 

1. Table name: prospect

2. Primary Key: prospect_ID_primary_key

3. $foreignkey = Get (TableLayoutName) & "::" & Get (TableLayoutName) & "_ID_primary_key"

4. Set Field [master_log::mater_log_foreign_id;$foreignkey]

 

Apparently, the Set Field function sees the contents of $foreignkey as text rather than the actual field name. Is there a way to do this?

Outcomes