Skip to main content
Planview Customer Success Center

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
  • Be sure to check off the "Field value is based on a formula" to create Custom Fields set by formulas
  • Using this function can help you in preventing run time errors in business rules. This is especially important since run time error will cause any add, update or delete operations that triggers these business rule to fail
Additional Links

numeric field

Custom Fields