Make a table of Tools with a field of "Name" and show those records in a portal. Put a button on the portal row and have it pull the related Name field as a script parameter. That script will use an If/Else If branch based on the script parameter to choose the correct script.
I'd done the Tools table and brought name into a portal. Can't the related field in the portal already have the Tools::name, 'name' and once it's pulled, how do I get from that to the appropriate popover containing the specific tool?
There's a bunch of ways...
Name the tool: In Layout mode, click on a tool (in an open Popover). In the Inspector, under the Position tab, give it a name ("Daily Report").
Give a related record the name "Daily Report"
Have the button run a script step: Go to Object: Tools::Name
I can see how I can name different portals as objects in order to call them via a script depending on the name/button clicked in the portal, but how do I call these from a single button in the portal row?
The Go to Object script step has a calculation box. I think you're best bet is to put Get ( ScriptParameter ) in that calculation box. And on the button in the portal row, set the script parameter to Tools::Name.
Your solution looks neat; I've not yet connected it's parts.
Just to clarify:
1. In the portal row I put a button: Is this an ordinary button or popover button? I need one popover button per tool since they will have different 'contents'.
2. My 'OnObjectKeystroke' triggered script has a 'Tools::Name' parameter.
The script has a single line: Go to Object [Object name; Get(ScriptParameter)]
3. Popovers: I have named these objects, but the script fails to open them unless I directly click the popover button.
I've checked that 'scriptparameter' is being correctly captured, but it doesn't succeed in 'Go to Object' to open the portal.
I suggest you post your file; or a similar example file. It's undoubtedly something very simple that you're getting wrong.
You are of course right! Mocking up the simple file, I found I'd labelled the popover button, when you need to label the popover as the object.
2 residual Qs:
1. Is it reasonable to 'line up' the popover buttons under the portal to keep a consistent opening position - FM seems to do it's own thing re. direction of popover window??? With duplicate buttons 'off layout' to make it easy to alter contents?
2. I have a record 'menu' on layouts Tool A and Tool B. However, they don't call records within the popover. What am I missing?
"2. I have a record 'menu' on layouts Tool A and Tool B. However, they don't call records within the popover. What am I missing?"
A lot, I'd say. I can't understand the question.
On these two layouts, you have a global field with a dropdown menu that has an attached on modify script.
The script seems to function correctly.
There is absolutely nothing about this that has anything to do with popovers.
What I meant was that the dropdown doesn't function within the popover, ie. it doesn't change the record in the popover (but does on it own layout).
I think you will need to understand something basic about layouts, table occurrences, and context.
The layout you're talking about first is Parent.
The layout you are searching is one of the tool layouts.
The found set of one layout has absolutely nothing to do with the found set of another layout.
Secondly, in the case of the popover, you will need to use a relationship for this purpose.
It also seems very questionable that you have two tables, Tools A and Tools B, with completely identical fields.
Seems highly likely that it should be ONE table, and A or B should be a field (category, manufacturer) whatever A and B represent in real life in your system.
Thank you; very helpful. The 2 tools tables were only examples; the real tools have v. different fields/structures.
Popovers/ global fields and dropdowns: I get it. I'm new popovers; I failed to think laterally in making contextual found set.
What is the set variable line (& $p) for in 'Select Tool'? I couldn't see the $p used later?