The function that doesn’t exist

2026 · Testing AI-written code · ChatGPT, Gemini, FileMaker WebViewer and WebDirect

On January 2, 2026, ChatGPT handed me a clean, confident piece of code for a FileMaker calendar widget. It used a FileMaker function called QuoteAsJavaScript.

There is no such function. There never has been.

The code looked right. The name sounded right. Something like it probably should exist. If I hadn’t spent years in FileMaker, I’d have pasted it in, watched it fail, and burned an hour assuming the bug was mine.

Plausible is the dangerous part

Nobody warns you about this part when you start building with AI: its mistakes look exactly like its correct answers: same formatting, same confidence, same tidy comments. A typo announces itself. An invented function in a well-written block of code doesn’t.

In the same conversation I pushed back on a second suggestion. It was escaping and substituting strings by hand to pass data into the web viewer, when FileMaker’s own Perform JavaScript in Web Viewer step could send the data cleanly. It wasn’t wrong, exactly. It was the long way around, written by something that didn’t know the platform’s shortcuts.

We kept going and the widget got built. Along the way we separated two kinds of update: a refresh the calendar asks for, and a push FileMaker sends without being asked. We also stopped assuming the web viewer already had its data, and loaded the session explicitly. Every one of those decisions came from knowing how FileMaker behaves. The model was quick to write the code once I told it.

The runtime it can’t see

Invented functions are the obvious failure. The subtle ones come from the environment.

  • Desktop versus phone. A Markdown preview worked perfectly in FileMaker on the desktop and showed a blank screen in WebDirect on an iPhone. Same code, different runtime.
  • WebDirect forgets. On desktop a web viewer can hold its state while you move between records. In WebDirect it reloads, and whatever the user was looking at is gone. Keeping that state took a different design, not a better prompt.
  • Too early. A blank white screen on load turned out to be FileMaker evaluating a calculation before the data it needed existed.
  • The window type mattered. A loading screen behaved differently depending on whether the script ran from a card window or a regular one. I found that by testing both. The AI could explain why only after I’d isolated it.
  • Browser security. Pointing a web viewer at local files ran straight into the browser’s same-origin rules, which no amount of clever JavaScript gets around.
  • The server, not the code. An API that worked on one machine failed on a NAS because Linux cares about upper and lower case in file names, and the old server didn’t.

None of these show up in the code. They show up when you run it, in the place it has to live.

Sometimes the bug is me

Honesty requires this one too. I once spent a session working through an error with Gemini: script permissions, API limits, trigger behaviour. All useful. Then I found the real problem. I had never actually created the FileMaker script the code was calling. I told it so: “the real error was the I never made a filemaker script called ‘Upload_to Supabase’…all fixed now”.

AI didn’t create that bug, and it couldn’t have found it. Only someone looking at the real file could.

What stuck

  • You are the runtime. The model writes for an imaginary environment. Your job is to know the real one.
  • Platform knowledge got more valuable. The faster AI writes code, the more it matters that someone can spot the function that doesn’t exist.
  • Isolate the variable first. Run the experiment, narrow down what changed, then bring the result to the AI. It’s very good at explaining a problem you’ve already pinned down.
  • Check your own side. Missing scripts, wrong names, the wrong thing on the clipboard. Not every bug is the model’s.

If you’re building with AI today

  • Look up every function you don’t recognize in the official documentation before you trust it.
  • Test in every mode your users have: desktop, browser, phone, every window type.
  • When something fails, describe what you observed, not what you think is wrong.
  • Keep the platform documentation open next to the chat. It’s the fastest hallucination detector you have.

Related: The WebViewer obsession · When the second AI just copies the first

Back to AI Journey Chronicles