Via a calculation: The RelationInfo design function? Parse the Source: value (#1).
Manually: hover your mouse over the arrow at the top left of the TO.
Not quite sure what you need.
Roll your mouse over the icon in the top left corner of the TO?
That does provide the information that I want, indirectly.
The task is to act on data that the user does not have rights for under their access privileges. For tables within the same file we can run the script with full access privileges. For external data sources we have to run a script with raised privileges in the remote file. We want to be able to determine when to trigger an external script, and where to run it.
Using the name of the TO in question, using Get(RelationInfo) we can discover the names of related tables. (This will fail if the TO does not have any relationships but lets ignore that.) Grab the name of the first table and use Get(RelationInfo) again. Now parse the result, looking for the original TO name, then grab the name of the file.
@steve_ssh sent me this:
A less roundabout way to get at the source file of a TO might be to query the FM metadata tables.
Specifically I'm thinking something like:
ExecuteSQL( "SELECT BaseFileName FROM FileMaker_Tables WHERE TableName = ?"; ""; ""; "MY_TO_NAME_GOES_HERE" )
to return the file name for a TO.
A good reference that I keep around for this stuff is:
Hope this helps & best,