LastErrorMessage Shell Properties

LastErrorMessage shell property accessors provide a central, single text value to help identify "what went wrong" in certain functions. This is a mechanism to get an error message back to the script for complex actions like running transitions or REST calls .

SetLastErrorMessage( value )

value (input).

Example:

Shell.SetLastErrorMessage("Some error message");

GetLastErrorMessage()

string (output).

Example:

var errMsg = Shell.GetLastErrorMessage();
if ( !myRec.StartTransition( 7 ) ) { 
  Ext.WriteStream( "Error occurred starting transition: " &&& 
  Shell.GetLastErrorMessage() ); 
}

ClearLastErrorMessage()

string (output).

Example:

Shell.ClearLastErrorMessage();

Related Topics

Shell Property Descriptions

Shell Properties by Context