May 11, 20178 yr 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....
May 11, 20178 yr 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.
May 11, 20178 yr Author 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, 20178 yr by crazybake
May 12, 20178 yr Quote ... it worked perfectly ... not sure how best to proceed Nor are we. It works perfectly. So you're done, right?
May 12, 20178 yr Author 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?
May 12, 20178 yr 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.
May 12, 20178 yr Author 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, 20178 yr by crazybake
May 12, 20178 yr "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, 20178 yr by BruceR
May 12, 20178 yr Author 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!
May 12, 20178 yr 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
May 12, 20178 yr 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."
May 12, 20178 yr 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
May 12, 20178 yr 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.
May 12, 20178 yr 6 minutes ago, BruceR said: it continues to function correctly. Yeah, well, that's what "undocumented" means.
May 12, 20178 yr 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.
May 12, 20178 yr 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".
May 12, 20178 yr 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.
Create an account or sign in to comment