How does this fail for you?
The scripts look OK though it's not a method that I use much anymore. (I prefer MagicKey as it avoids the need to change layouts)
But the relationships look problematic.
If these were FileMaker tables rather than shadow tables to an external source, the "Tee" connectors shown would indicate a global, unstored or at least unindexed match field. You can get away with one such in a relationship if you only use it to reference data from the context of the field with the unindexed field, but you can't have both unindexed and so the relationship doesn't look right to me.
The New ITA popover on the left opens with the last ITA record prepopulated. Changing any of the data edits that record ( I do not want to allow changes either after the initial entry.)
The New ITA Global popover on the right opens with the last information I attempt to add, but the record is never added nor are the globals cleared.
I am not sure what you mean by Tee connectors.
(Ignore the fmPanelistITA fm table and vw_Panelists_for_sunscreen_ITA shadow table on the relationship graph as that was me trying the same ideas but with an FM PanelistITA table and a SQL view from the Panelists table.)
As far as indexes, in the SQL server the tables are indexed properly. Am I understanding that FM has no idea that those indexes exist? Is there a way that this is done with shadow tables in FM?
(Sorry, I programmed for years in Access and VB/ADO.net before the major changes to the language and constructs. I guess I am just having a hard time grasping something that was quite simple to do in those programs.
I have always programmed stored procedures to add records in the SQL Server, but FM doesn't play nice with stored procedures.)
I can try magic key as I have read references to it, but based on my previous experience I didn't understand why the workaround was necessary as these type of one to many relationships aren't an issue in those programming languages.
I like what I see in FM and figuring this out is something I have to do.
"The New ITA Global popover on the right opens with the last information I attempt to add, but the record is never added nor are the globals cleared."
That would indicate either that the globals don't have global storage specified in field options or this script is not actually being performed.
If you have FileMaker Advanced, test your design with the script debugger enabled so that you can see which scripts are executing and step through them while using the data viewer to monitor the values in fields and variables.
The way relationship lines "connect" to table occurrence boxes take the form of a tee, a single line or "crowsfeet " depending on the field options specified so these didn't look right to me. But after checking a solution with ESS tables this seems normal and thus not a problem.
"That would indicate either that the globals don't have global storage specified in field options or this script is not actually being performed."
Yes, the field all indicate storage as globals.
I will check them with the script debugger.
If the script isn't being performed what would be the issue?
For the globals popover - I have the script on the add ITA button on the popover which is on the OnObjectExit script trigger.
Is it on the incorrect trigger?
There is no trigger on the New ITA global button that opens the popover.
1 of 1 people found this helpful
Hard to say without examining a copy of your file. But your script clearly clears the global fields so I listed the ways that would keep them from being cleared.
An OnObjectExit trigger, BTW, would need to be specified for the popover's panel and not it's button in order for that script to run when the popover closes.
"An OnObjectExit trigger, BTW, would need to be specified for the popover's panel and not it's button in order for that script to run when the popover closes."
That was the issue.
I should have posted weeks ago, but I attempt to figure stuff out on my own. Lesson learned.
A big thanks.
Thanks to philmodjunk for this. I was asked for this behaviour (in a different use case, but related) from a user last week and thought it might entail some working through and testing different script triggers but the suggestion worked first time.