Brian Dunning's FileMaker Custom Functions

CustomErrorMessage ( errorCode ; dynamicValue )

Maps internal error codes to clear, diagnostic messages. Used primarily in server-side transactional stacks (Create, Update, Delete) to enrich error payloads returned to clients or logged in Errors table.

  Be the first to rate this function Log in to vote

Dimitris Kokoutsidis   Dimitris Kokoutsidis - Show more from this author
Integrity Data
https://axelar.eu/

  Sample input:
CustomErrorMessage ( 5013 ; "invoiceTotal" )
  Sample output:
"invoiceTotal field could not be set"

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

This function maps internal error codes to clear, diagnostic messages.
Used primarily in server-side transactional stacks (Create, Update, Delete)
to enrich error payloads returned to clients or logged in Errors table.

▪ Supports dynamic values for embedding PrimaryKeys or FieldNames
▪ Ensures consistency in error reporting across modules
▪ Used in conjunction with `error.Text()` for native code explanations

====================================================================
PARAMETERS:

errorCode : Required — internal custom error code (≥ 5000)
dynamicValue : Required — context (PrimaryKey, field name, SQL string, etc.)

====================================================================
RETURNS:

• Readable error message as Text
• Injects dynamicValue where applicable (e.g., "Record with ID 123 not found.")
• Fallback message: "Unknown validation error" if code is unrecognized

====================================================================

 

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 22 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: