Update: Make sure to read Tony White’s comment below. It contains important additional information re: the behavior described in this article.
Recently I noticed some code that had worked flawlessly for years was suddenly returning “?” instead of valid values. What it came down to was that I had renamed my file from “JSON Custom Functions” to “JSON Custom Functions for FM 19.5”
Well you know those functions like ValueListItems…
ValueListItems ( fileName ; valueListName )
…that have a fileName argument? The culprit turned out to be that I was using Get(FileName) for that argument, and I needed to instead use
All 21 of the design functions are vulnerable to this, ahem, behavior. From the online help —
- If you specify a filename that contains a period, include the filename extension in the parameter. Otherwise, functions may interpret the period in the filename as the beginning of the filename extension, which can lead to unexpected results.
- If you specify no filename (
""), functions return results for the current file.
Bottom line: When using a design function and referencing the current file, use
"" instead of Get(FileName). There’s no down side, and your code won’t break if you decide to add a period to the file name.