JavaScript method: SCFile.getAttachment( attachID )

Gets a specific attachment associated with the current file record.

Values passed to getAttachment() will normally be ones obtained from a previous insertAttachment(), updateAttachment(), or getAttachments() operation.

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

Syntax

SCFile_object.getAttachment( attachID );

Arguments

getAttachment() takes one argument, which is a string containing an attachment ID of the cid:xxxxx form.

Return values

If successful, getAttachment() returns an Attachment object. Otherwise, it returns null.

Example

This example does the following:

  • Selects one record from the probsummary table.
  • Gets a specific attachment associated with the current record

This example requires the following sample data:

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

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

var attachmentObj = f.getAttachment( attachmentID );