ajModelError function
Description
The ajModelError retrieves error records from the Model Error List. This function is normally used together with ajRaiseError function.
Syntax
ajModelError([cell_reference], [error_code], [error_message])
Argument Name | Argument Type | Description |
---|---|---|
cell_reference (optional) | String | The cell address to be filtered and shown from the list of cell addresses added by the ajRaiseError function. The default value is an empty string (“”) which means no filter condition. |
error_code (optional) | String | The error code to be filtered and shown from the list of error codes added by the ajRaiseError function. The default value is an empty string (“”) which means no filter condition. |
error_message (optional) | String | The partial or full string condition to be used to filter and show the list of error messages added by the ajRaiseError function. It is case-insensitive. For example, records with an error message “ABCDE” will be shown with Error_message “b”. The default value is an empty string (“”) which means no filter condition. |
The function will return:
1) Return Value: Records from Model Error List
2) Return Type: Multiple values (array formula)
Examples
Here are a few examples of ajModelError function.
Example 1
First, we use ajRaiseError to add two errors into the Model Error List.
We can then return all errors from the Model Error List by using ajModelError with no parameters. This indicates no filter conditions should be applied.
Example 2
Using the same Model Error List as shown in Example 1, we define a filter condition this time.
The result shows that the filter condition is a partial match and it is case-insensitive.
Click here to download the use case workbooks for further reference.