Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

There appears to be a bug in FM9 (and probably prior) with the ValueListItems() function. If you pass a filename in the first parameter that contains a period, the function returns nothing. That is, if the actual name of the FM file on disk has a period in it (such as a file extention), then the ValueListItems function return "".

So.. if my filename is 'FMProDB' everything is fine. If it is 'FMProDB 1.0v1' the function fails.

This happens regardless of whether the first parameter is passed as a string literal (i.e. "MyDabase.fm7") or by using the Get(Filename) function as follows:

ValueListItems ( Get ( FileName ) ; "colors" )

I'm wondering if someone can verify this as a FM9 bug or not. I have only tested on Mac and would like to know if it also fails on Windows. Just create an empty database with a value list of custom values (i.e. colors, etc). Then use the Custom dialog script command (with the above line of code) to display the contents of the list. It will work if the filename has no period. It will fail if it does.

John

On Windows, I can confirm that, if file is Colors.v1.fp7 and I have value list called Colors and custom dialog is: ValueListItems ( Get ( FileName ) ; "Colors" ) ... that it does not work - it is blank. If I remove the period before v1, it works and lists the values.

UPDATE: Whether it is a bug or not ... I've always been taught never to have a period within name because the dot separates the file name from the extension. I suppose that's why most people wouldn't have noticed this oddity.

Edited by Guest
Added update

This is a known issue. It affects not only the ValueListItems() function, but any function that requires the file name. The solution is to include the file extension explicitly in the file name. This works even if you use Get (FileName) to return the file name dynamically:

ValueListItems ( Get ( FileName ) & ".fp7" ; "MyValueList" )

Of course, this is not required if you take care not to use period when naming your files.

This happens regardless of whether the first parameter is passed as a string literal (i.e. "MyDabase.fm7")

That is not my experience - maybe because I use the correct extension which is ".fp7"?

  • Author

Thanks much for the .fp7 trick. That works fine.

But.. the bottom line is that this is a bug. If it is possible for an end user to completely hose your app by simply renaming the database file with a valid Finder or Windows Explorer name, something is wrong. Both Win and Mac handle a period in the name just fine -- even including the extention period.

Also.. if a period in the file name was invalid, then many other things in FM would break that do not such as relationships across multiple files, lookups across multiple files, etc.

They need to fix this.

Of course it's a bug. But if you use more than one file in your solution (and these days who doesn't), it will still be possible for the end user to ruin it by renaming a file - even if this bug is fixed.

  • 2 years later...
  • Newbies

Thanks for posting this as I just ran into the same problem developing a DB in FMP Adv 11v03

The problem is the period in the file name. Known issue. Adopt a file naming convention that does not allow periods. Problem solved.

  • 5 years later...
On April 20, 2011 at 6:57 PM, Vaughan said:

The problem is the period in the file name. Known issue. Adopt a file naming convention that does not allow periods. Problem solved.

Here is the bug report and discussion on this long-standing FileMaker bug. 

https://community.filemaker.com/thread/133594

Please don't say "problem solved" when there is a bug that prevents people from doing very typical work behavior. Mac and Windows both allow non-file-extension-preceding periods/dots in file name, and most apps work properly, unless that app has a bug. Users should be able to rename files, unless you are saying FileMaker should only be used in very controlled corporate environments. In that case, FileMaker Inc. will need to adjust their priorities in what features they push, right? ;-) 

1 hour ago, DanShockley said:

Users should be able to rename files

How would that work in a solution with more than one file?

Developer Utilities is the only safe method of changing file names by changing all file references at same time.

As for ValueListItems() and if referencing local file, this works:

ValueListItems ( "" ; "your value list name" )

By not specifying the file name, FileMaker assumes it is the local file so you can safely rename the file.  That does not protect from multi-file solutions however.

I should add ... even if you only have a single file, renaming the file can break import scripts referencing the same file.  Nowadays, we set variables with the path and use it instead but before variables, imports were easily broken.

26 minutes ago, LaRetta said:

As for ValueListItems() and if referencing local file, this works:

ValueListItems ( "" ; "your value list name" )

Is this documented anywhere?

I don't think so.  I read it somewhere in a blog late one night and haven't been able to find it since.  :tongue2:

I tested it and it does work for many functions in versions 12 and up.

I haven't tried versions prior to 12.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.