JavaScript method: SCFile.doDelete()

This method removes a ITSMA Service Management record with any new field values defined in a Service Management file object. You must define a Service Management file object and new values for fields. This method is a synonym of the doRemove() method, and related to the more extensive doPurge() method.

Syntax

SCFile_object.doDelete();

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.doDelete();
 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 );