I have a button bar that allows me to switch layouts.
When I use the Customers list button I get the following
When I Cancel it gives me the Customer List
Non of the other buttons behave this way. The set up is the same for all. Any suggestions?
All I can think of is that something in your Customer List script is doing a find before/after going to the layout perhaps a GTRR (go to related record?). When you cancel the find it shows all records. If you have FMPA use the debugger and step through the script to see what is happening.
If there's no Find in the button script, also check for a layout script trigger on the target layout.
There are 2 triggers “Create Customer in List” and “Sort Customer List” These are the same two triggers for this layout in the “Invoices” starter solution from which this was taken.
If you are modifying an existing solution file, you still have to evaluate what trigger scripts are doing as you switch layouts. You want to modify the file's behavior, so you have to take charge of the whole thing, not just one change. The change of one piece can cascade in unexpected ways.
Exactly what I was thinking.
Perhaps there's an OnLayoutEnter script defined?
Anyone who doesn't have FMPA probably will upgrade to fix this type of error alone.
I looked in the triggers for the layout and found only an “On Record Load” trigger but nothing “On Layout Enter” I looked at an fresh solution and find only the OnRecrodLoad trigger and nothing else.
I'm assuming you tried the Script Debugger, right? Being able to step through the code would bring you to the place this is happening. With the debugger, it should be obvious what the problem is. Without the debugger, it could be much harder to figure it out.
You might want to do a Database Design Report (DDR). Since FileMaker doesn't have even basic search in Scripts (amazing, and should be embarrassing to FM for this lack of search - version 1.0 - functionality), you can still look at the DDR and see what all the scripts are doing. (Debugger idea is better).
Or, if you just have the regular FileMaker Pro, you could download a utility like "Developer's Assistant" that adds the basic search FileMaker should have had for years. That may help you find what's going on.
If you don't have FMP-Advanced, I would highly recommend it.
I’ll try the debugger and DDR
Cool. The debugger is really your friend here.
Retrieving data ...