KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to avoid "Undefined" and " ## Error # 48" when inserting expressions in 4D Write Pro
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: January 10, 2019

Whenever an invalid expression is inserted into a 4D Write Pro document, there are two possibilites that will occur.


  • "Undefined" - Expression could not be evaluated

  • " ## Error # 48" - Expression is forbidden


For "undefined", the expression could not be evaluated due to various reasons. Some examples include variables that were declared but not defined, methods with no return value, or nonexistent table field.

For " ## Error # 48", a forbidden expression will generally occur when inserting a project method that was filtered. By default, 4D will filter all commands and project methods in 4D Write Pro documents. In order to disable this filter, there is a setting found in the Design > Database Settings.



Another way to avoid " ## Error # 48" is to explicitly set which methods are allowed using SET ALLOWED METHODS. This way, you won't have to unfilter all project methods and have exact control of which methods will be allowed as shown below.

ARRAY TEXT($methodsArr;1)
$methodsArr{1}:="testQuery" // testQuery will simply query and return a full name
SET ALLOWED METHODS($methodsArr)


Before allowing "testQuery" method:


After allowing "testQuery" method: