Error messages
If you add a message
parameter in a validation function, a message appears if the result is false.
You can add the message parameter anywhere in the list of function parameters. A message can have up to 2000 characters. If the message is longer than 2000 characters, the message is trimmed to 2000.
isEmpty (value, message: "this value is not empty") is equivalent to isEmpty (message: "this value is not empty", value).
You can also include parameters in your message by using ${<asset property>}
. For more information on asset properties, go to Asset model.
message: "The description of the ${name} asset in domain ${vocabulary.name} is empty.".
When this message appears, name
and vocabulary.name
are automatically replaced by its value.
Note Message parameters entered in the when clause won't be considered.