Performing a find with a global variable.

Discussion created by pedantic on Feb 12, 2013
Latest reply on Feb 12, 2013 by flukey

My apologies for this very basic question, but I am missing something in the documentation because when I use a global variable, my find does not work. There may be a monkey wrench thrown in the works because I am performing a find on MySQL tables. AFAIK the MySQL tables are properly integrated into Filemaker 11 using ODBC. At least when I go to their layouts I see plenty of data.


Here's the code:


In script A I have this line:


set variable [$$JobKey, Value:MySQL_Jobs::nKey] // $$JobKey is set to 20993


Further on down the script I have this line:


Perform script [B]


In script B I have the following line:


Perform Find [Restore]


In the list of finds I have only one and it looks like this:


Action: Find Records


Criterion: MySQL_ODSubs::nJob_Key == $$JobKey // $$JobKey is assigned the value of 20993...I verified this in the Data Viewer.


This Perform find statement results in no records being returned. However if I chage the Criterion statement to this:


Criterion: MySQL_ODSubs::nJob_Key == 20993


I get the expected find list of two records.


Is there a special trick for handling variables in a Find statement?