crazybake Posted May 11, 2017 Posted May 11, 2017 I have a Value List "Quarter" with values: "Summer" "Fall" "Winter" "Spring" I planned to loop through these values and assign to a field using the various posts in the forum, but in testing the basic steps it's not working: Set Variable [$i; Value: 1] Set Variable [$quarters; Value: ValueListItems (Get (FileName); "Quarter") Set Variable [$count; ValueCount ($quarters)] New Record/Request Set Field [Program::ProgramQuarter; GetValue ($quarters; $i)] The field ProgramQuarter is not being set to any value....
comment Posted May 11, 2017 Posted May 11, 2017 Going by your description, the field should be set to "Summer". So there is something wrong with (or missing from) your description. Try using a custom dialog to check the values of your other variables.
crazybake Posted May 11, 2017 Author Posted May 11, 2017 (edited) Thanks for Dialog Box idea and you are correct, the variable $quarters is empty and the $count is 0. However, I created a new file and just added the Value List and the script and it worked perfectly My DB solution was originally created in FM13 and now developing in FM15... Not sure how best to proceed Edited May 11, 2017 by crazybake
bruceR Posted May 12, 2017 Posted May 12, 2017 Quote ... it worked perfectly ... not sure how best to proceed Nor are we. It works perfectly. So you're done, right?
crazybake Posted May 12, 2017 Author Posted May 12, 2017 Sorry for the vagueness. I started the solution in FM Pro 13 and within the last two weeks upgraded to 15. As a test, I simply created a new DB and only added the few elements I mentioned - and it worked. However, this does not help me fix the original solution I created and I cannot find out what the issue might be. Each element is the same between the original solution and the new one ( Value List and Items and the script). I guess I am asking... are there issue when moving solutions from 13 to 15 and higher? I did download 16, but still had the same problems... Would the best way be to create a brand new DB and import everything?
bruceR Posted May 12, 2017 Posted May 12, 2017 No. It should be an extremely simple problem and should work in all those versions. You are leaving out or wrong about some simple detail. Also; you mention a loop; but nothing about your solution uses a loop (yet). But the first step should work. i suggest you post your file or post an actual copy ( screenshot ) of your script.
crazybake Posted May 12, 2017 Author Posted May 12, 2017 (edited) The top two images are a script and the Value List - part of the solution that I have been working with for some time. Everything is disabled after the steps I mentioned above and with the addition of a dialog box. The bottom two images are a brand new solution with no fields or tables and with the script steps copied and pasted from my original solution. Script works in bottom, but not top Edited May 12, 2017 by crazybake
bruceR Posted May 12, 2017 Posted May 12, 2017 (edited) "Doesn't work" means what exactly? Also: for current file you can use ValueListItems ( ""; "quarter" ) Also: what exactly is the current file name - you are using non-recommended characters? Edited May 12, 2017 by BruceR
crazybake Posted May 12, 2017 Author Posted May 12, 2017 Interesting... Changing Get(FileName) to "" solved the issue....? Meaning, that previously, the dialog box would not display any results with the exception of the counter. With the change to "" it is now displaying results for each variable correctly. Thanks for the continued assistance!
comment Posted May 12, 2017 Posted May 12, 2017 12 minutes ago, crazybake said: Changing Get(FileName) to "" solved the issue....? Note that using "" instead of Get (FileName) is undocumented. You probably have a period in the file name - see:http://fmforums.com/topic/60368-fm-bug-with-valuelistitems-function/#comment-285448
bruceR Posted May 12, 2017 Posted May 12, 2017 Actually it IS documented. See FileMaker help, example here for ValueListNames. "If no parameter is specified for fileName, FileMaker returns results for the current file."
crazybake Posted May 12, 2017 Author Posted May 12, 2017 Thanks a ton; and you were correct, I did have a period in the filename.
comment Posted May 12, 2017 Posted May 12, 2017 5 minutes ago, BruceR said: Actually it IS documented. See FileMaker help, example here for ValueListNames. "If no parameter is specified for fileName, FileMaker returns results for the current file." The quoted sentence does not appear in the help page for the ValueListItems function - which is the function we are discussing here. What's even more interesting is that it has now been removed from the help page for the ValueListNames function too:http://www.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Fvaluelistnames.html%23
bruceR Posted May 12, 2017 Posted May 12, 2017 Help seems to be inconsistent on this subject across versions. The referenced statement exists for ValueListNames help in previous versions; and these functions began in FM6. And it continues to function correctly.
comment Posted May 12, 2017 Posted May 12, 2017 6 minutes ago, BruceR said: it continues to function correctly. Yeah, well, that's what "undocumented" means.
bruceR Posted May 12, 2017 Posted May 12, 2017 It IS documented; but the topic has been elevated appropriately within the help structure. Look under the Notes section within the general Design Functions topic. •If you specify no filename (""), functions return results for the current file. As mentioned. That's what DOCUMENTED means.
comment Posted May 12, 2017 Posted May 12, 2017 3 minutes ago, BruceR said: Look under the Notes section within the general Design Functions topic. •If you specify no filename (""), functions return results for the current file. Okay, then starting with version 16 it has moved from "undocumented' to "poorly documented".
bruceR Posted May 12, 2017 Posted May 12, 2017 You will find the sentence more or less randomly included in help for specific design functions in previous versions. Rolling it up to a single blanket statement within the higher level Design Functions topic seems like a good idea. It seems clear to me that this is how it is intended to work; these are all old, unchanged functions. YMMV, of course.
Recommended Posts
This topic is 3024 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