stefangs Posted September 24, 2019 Posted September 24, 2019 (edited) Hi all, I have a pretty simple navigation scheme with six buttons that are attached to this script: Go to Layout (Get (ScriptParameter)) I pass the name of the layout as the script parameter and it takes me to the corresponding layout. This works for five buttons, but one refuses to do anything. I've been tearing my hair out and squinting at the screen, trying to find a typo in the script parameter or the layout name, even deleted and carefully retyped, but it all looks good to me. The only thing that was different is the fact that I've added that particular layout after the button was already on the other layouts, but I can't see how that would make a difference. Btw, the offending layout name is "inventory", in case there's anything wrong with that. Thanks, Stefan Edited September 24, 2019 by stefangs
comment Posted September 24, 2019 Posted September 24, 2019 How about a minimized file showing (only) the problem?
stefangs Posted September 24, 2019 Author Posted September 24, 2019 (edited) Here it is. Thanks for checking it out! Nav_Problem.fmp12 Edited September 24, 2019 by stefangs
comment Posted September 24, 2019 Posted September 24, 2019 I don't see the problem: clicking the "inventory" button, from any layout, takes me to the layout named "inventory".
Steve Martino Posted September 24, 2019 Posted September 24, 2019 I stopped hard-coding names in script parameters after I read this article: http://www.philosophyoffilemaker.com/robust-filemaker-design-87 opting instead to use the custom function: getLayoutName to get the internal ID number of the layout
stefangs Posted September 24, 2019 Author Posted September 24, 2019 20 minutes ago, comment said: I don't see the problem: clicking the "inventory" button, from any layout, takes me to the layout named "inventory". What? When I click 'inventory', nothing happens. I swear! Do you believe me or should I make a video? I'm stumped.
LaRetta Posted September 24, 2019 Posted September 24, 2019 (edited) Are you really on version 13? Added: And if you use a custom function, you'll need to provide it in the file and refer to that in your script parameter so we can see what you are ACTUALLY doing. 🙂 Edited September 24, 2019 by LaRetta
stefangs Posted September 24, 2019 Author Posted September 24, 2019 13 minutes ago, Steve Martino said: I stopped hard-coding names in script parameters after I read this article: http://www.philosophyoffilemaker.com/robust-filemaker-design-87 opting instead to use the custom function: getLayoutName to get the internal ID number of the layout There's always a more elegant way, but the first sentence in that article sums it up for me: >>Have you ever inherited a system built by someone else, changed a field’s name and everything stopped working?<< I don't work on other people's files and nobody works on mine, so I can live with that. It is just so nice and easy. 2 minutes ago, LaRetta said: Are you really on version 13? Added: And if you use a custom function, you'll need to provide it in the file and refer to that in your script parameter so we can see what you are ACTUALLY doing. 🙂 Yes, v13 and no custom function.
LaRetta Posted September 24, 2019 Posted September 24, 2019 Disable the Go To Object[] in your script and then save the script. Does it work for you then?
stefangs Posted September 24, 2019 Author Posted September 24, 2019 9 minutes ago, LaRetta said: Disable the Go To Object[] in your script and then save the script. Does it work for you then? No, that step was added later. The script didn't even work for me before I added that. So since it appears that this script works for everyone but me, it must be something peculiar in my setup. Could it be useful to reinstall FMP?
stefangs Posted September 24, 2019 Author Posted September 24, 2019 Very strange. The file also has never crashed on me. I will try to create the script over again and remap it to the buttons and see what happens. Thanks,
comment Posted September 24, 2019 Posted September 24, 2019 42 minutes ago, stefangs said: What? When I click 'inventory', nothing happens. I swear! The only explanation I can think of is that we are not using the same file. Try downloading what you posted here.
stefangs Posted September 24, 2019 Author Posted September 24, 2019 49 minutes ago, comment said: The only explanation I can think of is that we are not using the same file. Try downloading what you posted here. Did that - same thing.
comment Posted September 25, 2019 Posted September 25, 2019 Then I don't know. Ostensibly, if the same file behaves differently on two systems, then the problem is with the system, not with the file. However, I have never encountered this kind of problem. A shot in the dark: do you have any system-enhancing utilities installed? Perhaps one of them is interfering.
OlgerDiekstra Posted September 25, 2019 Posted September 25, 2019 7 hours ago, stefangs said: Did that - same thing. Have you debugged the process? Ie, open the debugger, then step through each script step after you pressed on the button. This allows you to view values in the fields/variables and determine whether they are as expected. Keep an eye on the bottom of the debugger for any errors.
stefangs Posted September 25, 2019 Author Posted September 25, 2019 3 hours ago, OlgerDiekstra said: Have you debugged the process? Ie, open the debugger, then step through each script step after you pressed on the button. This allows you to view values in the fields/variables and determine whether they are as expected. Keep an eye on the bottom of the debugger for any errors. The script is only 1 line :-) 5 hours ago, comment said: Then I don't know. Ostensibly, if the same file behaves differently on two systems, then the problem is with the system, not with the file. However, I have never encountered this kind of problem. A shot in the dark: do you have any system-enhancing utilities installed? Perhaps one of them is interfering. Not that I know of. It's just a plain vanilla installment. I will try to install on my wife's laptop which is similar and see if it works there. Thanks much,
stefangs Posted September 25, 2019 Author Posted September 25, 2019 Just to wrap this thing up (hopefully), I have renamed the script parameter and layout name from "inventory" to "inventoree". Now it works. But changing it back to "inventory" breaks it again. It's almost like "inventory" is a reserved word. So "inventoree" is it then. The word never shows to the user, so I suppose I can live with it. Thanks all for your help and checking out the file.
comment Posted September 25, 2019 Posted September 25, 2019 26 minutes ago, stefangs said: changing it back to "inventory" breaks it again. Are you sure you don't have some sort of text-expanding utility installed?
stefangs Posted September 25, 2019 Author Posted September 25, 2019 I don't even know what that is, so I probably don't have one.
LaRetta Posted September 25, 2019 Posted September 25, 2019 Are you SURE you don't have two layouts named Inventory" BTW, how many layouts do you have (in layout mode, how many total 'records' are listed?
stefangs Posted September 25, 2019 Author Posted September 25, 2019 I have 6 layouts, only one is called inventory, although it's inside a folder also called inventory, but that applies to other layouts in a similar fashion as well. Also, it seems to work for the folks here who tried my file, but not on mine.
OlgerDiekstra Posted September 26, 2019 Posted September 26, 2019 8 hours ago, stefangs said: I have 6 layouts, only one is called inventory, although it's inside a folder also called inventory, but that applies to other layouts in a similar fashion as well. Also, it seems to work for the folks here who tried my file, but not on mine. Most people here are testing with newer versions. Just to rule it out, rename the layout folder to something different and see if it works. I vaguely remember an issue with layout folder names being the same as layout names, being the reason why I never name folders the same as layouts. It may be a case where the other layouts were created prior to being stored in folders. You probably created the folder first, then the inventory layout, as that structure was already in place. It's possible the order of creation is significant. This post deals with similar issues: https://community.filemaker.com/en/s/question/0D50H00006h92UZSAY/psa-fieldnames-function-affected-by-layout-folder-names 1
comment Posted September 26, 2019 Posted September 26, 2019 31 minutes ago, OlgerDiekstra said: Most people here are testing with newer versions. That is a good point.
stefangs Posted October 6, 2019 Author Posted October 6, 2019 You guys are awesome. This was, in fact, the problem! I have renamed the folder and then the layout back to inventory. Now it works! Incredible. The odd thing is, that I am doing the exact same thing with the other layouts which also have folders with the same name. For some reason, it didn't choke on them, only with 'inventory'. The only difference I can see is that, up to now, the inventory folder only contains a single layout. Whatever the reason, I'm very happy that the problem was found. Thanks so much!
comment Posted October 6, 2019 Posted October 6, 2019 (edited) 1 hour ago, stefangs said: The odd thing is, that I am doing the exact same thing with the other layouts which also have folders with the same name. For some reason, it didn't choke on them, only with 'inventory'. It could be a matter of which was created first (or last?) and took over the spot that intercepts all the calls. Since we are dealing with a bug that was apparently fixed in later versions ... Edited October 6, 2019 by comment
stefangs Posted October 6, 2019 Author Posted October 6, 2019 True - that layout was created last, so that would make sense, as far as a bug can make sense. Unfortunately, I missed the upgrade phase after v13, so I will need to get a full version again. Pretty stiff upgrade policy, but that's not really a complaint.
Recommended Posts
This topic is 1965 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now