JavaScript method: SCFile.getLastRC()

This method returns the most recent global return code value generated by the SCFile object. You can then use the RCtoString global method to convert the return code into a string.

Syntax

SCFile_object.getLastRC();

Arguments

There are no arguments for this method.

Return values

One of the global return code values.

The method returns the most recent global return code value generated by the SCFile object.

Example

This example does the following:

  • Inserts a new record into a local variable
  • Displays the return code of the insert operation

This example requires the following sample data:

  • A valid record in a local variable (for example, $L.file)
system.vars.$L_file.doInsert();
var rc = getLastRC();
if ( rc == RC_SUCCESS )
 {
  print( "Insert of document succeeded" );
 }
 else if ( getLastRC() == false )
 print( "Error " + RCtoString(rc) + " occurred trying to insert the record" );