JavaScript method: SCFile.deleteAttachments()

Deletes all of the attachments associated with the current file record.

Before calling deleteAttachments, you must establish a current record using one of the positioning methods, such as doSelect(), getNext(), etc.

Syntax

SCFile_object.deleteAttachments()

Arguments

deleteAttachments() takes no arguments and returns no arguments.

Return values

If successful, deleteAttachments() deletes all of the attachments associated with the current record.

Example

This example does the following:

  • Selects one record from the probsummary file
  • Deletes all attachments associated with the current record
  • Displays the number of attachments associated with the current record

This example requires the following sample data:

  • Record number IM10001 in the probsummary file
					
var f = new SCFile( 'probsummary' );

var rc = f.doSelect( 'number = "IM10001"' );

f.deleteAttachments();

var attachments = f.getAttachments();

print( attachments.length );  // will be zero