Are you using FMPA?
I would use script debugger to find out when the script is running exactly. You may have a trigger on a layout or a field that is modified by the length script.
Aside from that the Database Design Report should have some info as well.
You're executing a Go to Layout if your FoundCount is 0. Do you have an "OnLayoutExit" or "OnLayoutEnter" script running?
I am using FMPA.
I used script debugger to find out that the UBD Board Viewing script was being executed. The problem is, script debugger didn't show what triggered the script.
I do have "OnLayoutEnter" to run a script for re sizing the Layout window ONLY
If you've got FMPA, pull a DDR. Search for UBD Board Viewing. That will help you find all occurrences of the script, and you'll be able to determine what is calling it.
I've found the object that triggers "UBD Board Viewing", it's a field "Board No." and when a user clicks on it it triggers "UBD Board Viewing", it is not suppose to be triggered when returning or entering the layout. The "Board No" field has the Script Trigger: OnObjectEnter;UBD Board Viewing
I still don't see what is triggering "UBD Board Viewing", none of the search scripts that execute do anything with the "Board No" field.
Is the "Board No" field the first field in the tab order of the layout? When the user is returned to the layout in question, the focus may be going to that field without the user actually having to click into it manually.
Hope this helps,
The script you posted first...which layout is it being run from? At the end, if your found count is zero, you're going to , RetailView List_Find. That tells me you may be running the script from RetailView List. When you don't find what you're looking for, you're going to "RetailView List_Find". The OnLayoutEnter script would run after the layout is loaded. You should see that script run and complete BEFORE "UBD Board Viewing" runs. Does it? Does the OnLayoutEnter script call any other initialization scripts? Does it set any variables? Does it have any "Go to Field" steps?
I believe I know what's happening.
On your layout, I suspect "BoardNo" is the first thing in your tab order, as Todd guessed. As soon as your Get ( FoundCount ) is empty, your script enters find mode. As soon as that happens, the first object in your tab order automatically gains focus. When an object gains focus, "OnObjectEnter" triggers fire. That's probably when the "UBD Board Viewing" script is running.
See the attached screen shot. Notice how I've clicked both boxes for "Enable in:"? I created a simple layout with just one field, set to fire a script OnObjectEnter. When I enter Find mode with the trigger enabled in Find mode...the script triggers. Unclick the "Find" option, then see if your script quits firing. I suspect that it will.
Triggers a script to run when a layout object becomes active as a result of the following:
• a user tabs to the object
• a user clicks the object
• a script step causes an object to be entered--The
• a user moves between repetitions in a repeating field