AnsweredAssumed Answered

External Data Source via $$global variable not updating

Question asked by triac on Jan 11, 2019
Latest reply on Jan 11, 2019 by philipHPG


I am attempting to make use of the $$global variable option in FM16+ for External Data Sources. The issue I am running into, is that updating the $$global variable doesn't seem to cause its External Data Source to update.


Example, I've set up an External Data Source called "EXTERNAL" (without quotes) which resolves to "$$EXTERNAL" (also without quotes). Next up, the following script is run from the context of a table which contains one server address per record, and each server is hosting a copy of the same 'target' file:


Go to Record/Request/Page [ First ]


     Set Variable [ $$EXTERNAL ; Value: "fmnet:/" & Server::IPAddress & "/MyExternalFile.fmp12" ]

     Open File [ Open hidden: OFF ; "EXTERNAL" ]

     Go to Record/Request/Page [ Next ; Exit after last: On ]

End Loop


What happens here, is that the first instance of MyExternalFile.fmp12 does in fact open, from the first server, as defined by the variables, all is well. What "should" happen next, is that we advance to the next server record, get that next server IP, reset our variable to reflect the new server, and then open our target files as it resides on that second server. I should now have two of MyExternalFile.fmp12's open. But I only have that first original one open from the first server. The second one never opens. Even though the $$EXTERNAL variable has clearly updated to the new server's address, as evidenced by the Data Viewer, FM seems to "disobey" the newly minted variable and just re-open the first one. No errors are generated.