JavaScript method: SCFile.setBinary()

This method saves binary data to a field in a ITSMA Service Management file object.

Syntax

SCFile_object.setBinary (fieldName, binaryObj);

Arguments

The following arguments are valid for this method:

Argument Data type Description
fieldName String The name of a field in which you want to save the binary data.
binaryObj String The name of a JS object that contains the binary data.

Return values

RC_SUCCESS or one of the other global return code values. The method returns RC_SUCCESS if the method successfully saves binary data to a Service Management file object or returns one of the error global return code values if the method cannot save binary data to a Service Management file object.

Example

var f = new SCFile("contacts");
rc = f.doSelect('contact.name#"AARON"');
var attachmentObj = f.getAttachments();
var b = new SCFile("blob1");
b.name = attachmentObj[0].name;
b.setBinary ("data",attachmentObj[0].value );
rc = b.doSave();