Brian Dunning's FileMaker Custom Functions

fm.errorcodes.json

Returns all default FileMaker 17 error codes as a JSON object { error : {} } stored in a global variable $$JSON_fmErrorCodes

  Be the first to rate this function Log in to vote

Daz Lunn   Daz Lunn - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Sample usage: JSONGetElement ( $$JSON_fmErrorCodes ; "error." & Get ( LastError ) )
  Sample output:
Returns "No records match the request", when last error was 401

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Back-story:
I've returned to FileMaker after ten years away. A lot has changed; for the better. I was learning the JSON function syntax. This CF seemed a fun thing to do whilst re-learning. Actually, it turned out to be quite useful in re-learning FM errors. So, I thought I would share it.

Whether this CF has real world use-cases, I'm not sure. Maybe.

So, it basically creates a global variable ($$JSON_fmErrorCodes), which contains the JSON object { error : { } }. I call this a reference object, because I use it similarly to how I would use a Dictionary.

You interrogate the error object thus: JSONGetElement ( $$JSON_fmErrorCodes ; "error." & Get ( LastError ) ) ... it returns the text description of the FM error (see CF Definition text, for reference).

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.