It would be wise to use the Name box in the Inspector to give your portal an object name. Go to Portal Row does not specify the portal and acts on whichever portal a) has the focus or b) if no portal has the focus whichever portal is first in the tab order. You would then go to the portal row first, then go to the field in that portal row.
So these four steps should be in your script in this order:
Go to Object
Go to Portal row
Go to field
Exit Script [false]
I had actually tried that, to no avail, and I tried again to be sure, nothing. BUT, what DID work was doing
Go to Object
Go to Portal Row
Go to Object
Exit Script [Result:False]
My idea was that there was another version of that field hiding somewhere between layout objects that I couldn't find that it would go to instead, which is why I deleted and created a new one, to make that one dissappear.
That field still will not let itself intered with Go to Field which is very strange indeed, but oh well, go to object does the same thing here so I'm happy :)
Thanks for the suggestion Phil!
If you have FileMaker Advanced, it might be enlightening to run this script and the original version in the debugger so that you can watch and see what get's the focus and when.
Yea, I always do that back and forth with problems like these, it opened the popover with the Perform Script step as intended, went absolutely nowhere with the Go to Field step, to the last Portal Row, and then nowhere again.
What I forgot to mention, that also fired my suspicion that FIleMaker had got the codes wrong, is that earlier, for no apparent reason, it went to a whole nother field than intended with the Go to Field. Something like this:
Go to Field [Table::Worker]
Go to Portal Row [Select; Last]
Go to Field [Table::Address]
Exit Script |Result; False]
And then it went to the field Table::Phone Number O.o and it wasn't even in the tab order this field.
When I deleted this field from the layout, it seemed like it didn't have any idea where to go, so it just went nowhere from there on. I don't know much about coding, no earlier experience or education, but it to smells like some wrong codes where FileMaker recognizes the wrong fields for who they really are.
What I fear is that I've somehow messed up the file by copying and pasting the .fmp12 file too much or something as this isn't the first time I've experienced strange these like this.
Sometimes, also for no apparent reason, it just decides to behave like there's a modal window open, making me unable to do practically anything in the file until I click somewhere outside of the program, like on the desktop, and into FIleMaker again. Then, suddenly it decides to work properly again. This rarely happens anymore, and as far as I can tell, usually/only when I interrupt scripts gone wrong, like scripts stuck in a loop, even though this script hasn't opened a modal window or anything. Really baffles my mind, but as long as it just occurs when you interrupt scripts, which you won't do in the end product, it shouldn't be a problem, but I am worried that I have made such a fatal error to the file somehow that I will have to start all over again, as I've come quite far.
It is possible that your layout is damaged and this is why the script is failing to put the focus where it should. I saw this happen one back when FileMaker 10 was the latest version and I about went crazy until I deleted the layout and started over.
Ahh, interesting, I'll have to look into that if these problems persists. Would it in that case suffice to just copy all the objects in the layout, paste those objects into the same layout again and re-arrange scripts, layout script triggers etc. to make it exactly how it was before, or would I have to start from scratch and build everything from ground up again, meaning adding all field preferences, conditional formattings and what have you manually?
This is the main layout I'm talking about, which is packed with functions, I'd hate to build most of that up again.
Unfortunately, we can't see what is broken. For all we know, two of the layout objects have some sort of non-unique ID or other such problem. Thus, if we copy/paste from the problem layout to the new layout, there is some small chance that we have copy/pasted the trouble along with the layout objects.
True. I'll just leave it as it is for now then, that layout is more or less done now and I've never had any other problems with it before other than the "modal window problem", which I haven't experienced in quite a while anyway.
Anyway, thanks for your help, gained some insight which can prove very useful.