Catch Function
Catch (expression as Object, errorValue as Object) as Object
Category: | Common |
Description: | Returns a value of the expression or errorValue in case that expression throws a runtime error |
Supported Context: | FormulaField And BusinessRules |
Parameters: | |
expression as Object | Field or reference to a field of an object |
errorValue as Object | Resulting value if the expression throws a runtime error |
Returned value as Object | Returns the desired error value if the expression throws a runtime error, else returns "null" |
Example #1 |
Create a custom numeric field that automatically converts the last 5 characters of a work item name into a number value. In the case where the custom number field was manually inputted incorrectly (i.e. does not contain numeric characters), set the errorValue to "-999". Catch(ToNumber(Right($Name,5),-999) |
Tips |
|
Additional Links |
numeric field Custom Fields |