On what object did you set the OnObjectKeystroke trigger? Did that object have the focus at the time you pressed a key?
Also, whether you have enabled "allow creation of related records via this relationship" will determine whether go to portal row [last] puts the focus on the last existing portal row record ("allow creation" is not selected) or in the blank "add row" for adding a new portal record.
In what way does your script "not work"?
What is this script supposed to do?
Here's an update Phil, and I am also posting an example file. Originally I had a stupid approach of a onkeystroke trigger to refresh objexts and button set up for the variable.
I am posting my example file of the broader thing I was trying to do. As to my original problem, it did not appear when I made the example anew. But it did appear in my solution. It consisted of filemaker twice denying to go to a portal despite the name on the inspector and the script being the same, verbatim and checked about ten times. It ignored it. Upon a third try the same names coinicided.... That's my 2cs at least in what I see as a bug. Please let me know of any unwarranted metadata in the example file...oh can I not upload an fmp12 file?
I cannot from your posted description, figure out what you are tying to do or why.
You can only upload image files directly to the forum, but you can upload a demo file to a file sharing site such as drop box and then post the download link here in your next comment to the forum.
Yes, but first give another try and explaining what it is that you are trying to accomplish with this layout design.
And if your file has more than one layout, please identify the layout on which you set this up so that others do not have to search different layouts out trying to find the one where you set this up.
Three Tables, one parent with two children. One layout with a tabbed panel of two, a portal from the first table in one, a portal from the second in another. In the first portal just a token field and record, the pk. In the second I have two buttons outside the portal. They artenatively show or hide merge fields and normal fields as to give a lock effect on records. I use a global variable for that. That's pretty much it.
the portals are from the child tables obviously.
It seems an uneccessarily convoluted design.
Your current script is always executed when $$LockToggle = "Off" as the script trigger changes it to that value when you select the second panel of the tab control.
When the value is set to that value, the button's script only does a go to object, go to portal row. And it does do that as the first portal row changes color to so that it is the active portal row.
Note: A field with a behavior setting (in the Inspector) to deny browse mode access will also be "Read only" and is easier to place in your portal thatn using a merge field.
I can't believe Safari crashed on me as I was writing the third paragraph of this post. Thanks for the tip about merge fields and using normal fields instead. I rather like merge fields because I can use whole sentences instead of mere fields when I replace it in a locked record; for example in the solution I am building I include a time sheet that can be locked and when it's locked instead of the input fields I have a full sentence incorporating these details as well as others via merge fields.
yes this change of variable on the tab change was just a debug thing. In my solution I keep a Boolean field for each employee which is the lock toggle so when they lock it stays that way unless they unlock it.
many thanks again for your help.