your description is pretty vague,
What I assume you are trying to do is set a variable in table A (global), so that related records from table B are displayed on a report you are generating a PDF for. And you are generating a PDF for each unique set of values in table B.
If this is correct, you need to get a loop script going to process all the options from table B. I have created the attached demo file that shows how to do this.
I use ExecuteSQL to get a list of the "groups" from table B, then on a table A layout, I loop through each iteration of the list, set the global field in table A, and generate a PDF for each value in my list from table B.
The relationship is based on a global table in table A to a match field in table B.
tableAtableB.fmp12.zip 65.1 K
Thank you so much!
The long version I have a 52 records which are calendar events Table A and I have to hand it out to a group of teachers (Table B).
I need the report to show the 52 events and the 1 global field to show the teachers name for Table B on the top.
I'm trying to learn and understand how to write the set field script and loop script.
Once again thank you for all your help!
My example covers setting a field inside of a loop script, You could repurpose what I demonstrated easily to perform what you needed to do.
Just change the relationship to be on tableA::global = tableB::teacherID
Then change the sql to:
ExecuteSQL(“SELECT DISTINCT(teachername) FROM tableB”;””;””)
everything else was pretty much context-free.
Once again thank you! I'm really trying hard to understand it as I'm a beginner the file you attached I could few the scripts it said the file was locked.
Did you make sure to properly unzip the file? Also are you using FM13?
I did it says file is not modifiable, I'm using filemaker pro 12 advanced.
You are correct! I unzipped again and it did work. thank again
Thank you so so much! I followed your instructions and it worked like a charm. I don't know SQL but it worked.
ExecuteSQL() is an insanely useful function. You should definitely learn it.
Here’s an exhaustive blog post that covers everything you really need to know to get started:
thanks for all your support