I recently encountered an error that I know other developers have run into. It's "Error 102" which indicates that a referenced field is missing. The error started to be thrown by one of our PHP applications. The code that was throwing the error is used to find a record. The bizarre thing about the error being thrown is that nothing -- and I mean nothing -- had changed in the FileMaker database.
Here's what I did to resolve the issue...
1. I first confirmed that the layout being used to do the find (the layout being referenced by the newFindCommand method) was the correct layout, and that the name was spelled correctly in the PHP code. It was.
2. Next, I confirmed that the field being searched on was on that layout, and that it's name was spelled correctly in the PHP code. It was.
3. I then checked to see if the FileMaker account that PHP is using to access the database has the permissions that it needs to access the data. It did.
4. I then tried restarting Web services, and that didn't help.
5. At the desperation stage now, I shut down FileMaker Server, and rebooted the server. This had no effect, as the dreaded 102 error was still being thrown.
6. I decided to "give PHP something to cry about" and actually removed the field that it claimed it couldn't see. I saved the layout changes. I then went back into layout mode, added the field back, saved the changes, and...
Voila! That worked!
I have no idea why this worked, but it did.
So if you run into this same issue, where PHP suddenly cannot "see" a field that you know is on a layout and that it should be able to see, remove the field from the layout and add it back.