ajRaiseError function
Description
The ajRaiseError function adds an error element into the Model Error List. This function is normally used together with the Excel "IF" statement and ajGetModelError function.
Syntax
ajRaiseError(error_message, [error_code] , [cell_reference] , [run_condition], [run_by_function_point_only])
Argument Name | Description |
---|---|
error_message (required) | Specify the error message of a record to be added to the model error list. |
error_code (optional) | Specify the error code of a record to be added to the model error list. If you do not specify anything, the default value will always be an empty string (“”). |
cell_reference (optional) | Specify the cell address that produces this error. If you do not specify anything, the default value will always be the cell this function is in. If another cell address is used, it is recommended to use ajGetAddress to specify the address. |
run_condition (optional) | The function will run when the value is TRUE. Otherwise, it will not run. If you do not specify anything, the default value will always be TRUE. |
run_by_function_point_only (optional) | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Run Function Point. If it equals TRUE, the function can be executed with Run Function Point (AlchemyJ toolbar \ Run Function Point) only. If you do not specify anything, the default value will always be TRUE. |
The function will return:
1) Content type: TRUE / #VALUE!
2) Method: Within a cell
Example
The below example adds an error with the information specified in cell B1, B2, B3 to the Model Error List.
This function returns TRUE if the exception has been successfully added to the list. Otherwise, it will return #VALUE!.
After a function point is run in AlchemyJ Studio, it pops up a message to show all the errors on the Model Error List and System Error List. Both error lists are at the function point level. They reset every time a function point is run.