JavaScript method: SCFile.doRemove()

This method removes a single HPE Service Manager record matching the field values defined in the Service Manager file object. To remove multiple records use the doSelect method to store a record list as a JavaScript object, and then use the getNext, getPrev, getFirst, or GetLast methods to bring a particular record into memory for removal. It requires defining a Service Manager file object. This method is a synonym of the doDelete() method, and related to the more extensive doPurge() method.

Syntax

SCFile_object.doRemove();

Arguments

There are no arguments for this method.

Return values

RC_SUCCESS or one of the other global return code values.

The method returns RC_SUCCESS if the method successfully removes a record or returns one of the error global return code values if the method cannot remove the record.

Example

This example does the following:

  • Searches the probsummary table for any interaction record you define in the search variable
  • Removes the interaction record

This example requires the following sample data:

  • A valid value for the number field (for example, "IM11111")
var numberValue;

function removeInteraction( num )
{
 print( "Removing interaction record..." );
 var interactionRecord = new SCFile( "probsummary" );
 var findRecord = interactionRecord.doSelect( "number=\"" + num + "\"");
 print( "The interaction record is " + interactionRecord );
 var rc = interactionRecord.doRemove();
 if ( rc == RC_SUCCESS )
 {
  print( "Success. Removed record " + interactionRecord.getText() );
  return interactionRecord
 }
 else
 {
  print( "Could not remove record. " + RCtoString( rc ) );
  return null
 }
}

numberValue = "IM11111"
removeInteraction( numberValue );