Did you try to name the field, then use 'Go to Object' instead? Seems to work better sometimes. Or, duplicate and use the same Go to Field script step twice.
I think, and I don't know the right technical reason, if the script or another script trigger commits data or refreshes (redraws), the Go to Field script step sends you to the first field in the tab order.
edit: If you didn't already know, to name a field, or any object, click on field in layout mode, open Inspector>> Position Tab (in FMP12). Where you see name, type in a name for the object. Then refer to that name in the script (spelling counts)
We did try the GoTo Object as well and it did the same thing. So we just went back to the GoTo Field option and are trying to get it to work. We have not tried the double script step of Go To Field. We will try that.
I suspect that your script includes a commit records step which then changes the focus from the portal row back to the layout as a whole--which will drop the cursor into the field that is specified as first in the layout's tab order. Your "OnOBjectModify" script may also be tripping a different script trigger that performs a second script that changes the focus.
The quick fix is to set a variable to Get ( ActivePortalRowNumber ) and precede go to field (or object) with go to portal row and use the variable to specfiy the portal row and to also keep any such other trigger controlled script from interfering.
A more long term fix might be to remove this script completely. With the correct relationship, you can set up this fields to auto-enter the needed values instead of by script.
The script does not have a commit record step. It really is a simple script, that has three Set Field commands to auto fill in three particular fields and then the last step is GoTo Field Quantity. Those four steps are wrapped in an IF statement to validate if is should run.
IF <condition is met>
Set Field A
Set Field B
Set Field C
Go To Field Quantity
to repeat: Your "OnOBjectModify" script may also be tripping a different script trigger that performs a second script that changes the focus.