Beware File Names

A good example that we never stop learning. I’ve been forced to do a job using FileMaker 14 ( :weary:), whch has led to discovering that a function released in FMP v6 can break in all FMP versions Mac or Windows depending on the way the file is named.

The file I had been given was named in the format ‘FileName v1.2.1’, I know periods are not recommended in file names, but this was someone else’s file I was adding functionality to.

Simply, the FieldNames (filename ; layoutname) function fails if the file name includes a period.

Time lost tracing this one, but richer for the knowledge. I replaced the periods with underscores in the file name and trapped for this within the startup script to prevent the client reverting.

4 Likes

Sounds like FMI used this "period problem" code when implementing the current JSON functionality - which, last I heard, still has this multi-year bug. :innocent:

Thanks for this heads up, @AndyHibbs.

If I am not mistaken, another way to work around this may be to supply an empty string to FieldNames for the filename parameter:

Caveat: Above screenshot is not from v.14

1 Like

2 things on the FieldNames function...

  1. Good reminder PSA, thanks...
  1. The FieldNames (filename ; layoutname) has another gotcha...

DIGFM: Deepen your relationship with the FileMaker Platform (2/14/2019; Santa Clara, CA) (24 minutes in)

...which shows up...even in some FileMaker files published by friends of ours.

TLDR: do NOT name Layouts the same as (correction from the audio: "here table means Table Occurrence, NOT BaseTable")

2 Likes

Sorry you got caught out @AndyHibbs.

@tonywhitelive, I'm guessing that the gotcha for using the FieldNames function when the layout name and TO name are the same is that the function has to decide whether to return all field names ( TO name wins ) or return only the field names on the layout ( layout name wins ). Do we know which object wins?

1 Like

Yes, that is the gotcha.

A) Layout wins.
image

Gotcha free naming convention:

I've been hit by similar problems from multiple different languages/commands. My rule of thumb... only use alpha characters and underscores, and maybe numbers. Anything that could be considered a word break can cause unintended consequences. The only time in production code that I deviate from this when writing new code, is using a '-' for a data separator for a report that I'm emailing.

2 Likes