You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This server class provides methods that allow operating with attachments.

copy(sourceTable. sourceID, targetTable. targetID)

This method copies attachments from the source record to the target record.

Parameter(s):

NameTypeMandatoryDefault Value
sourceTableStringYN
sourceIDStringYN
targetTableStringYN
targetIDStringYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

copy
let attach = new SimpleAttachment();
attach.copy('user', '155964310500000059', 'sys_script', '155964310500000051');

deleteAttachment(attachmentID)

This method deletes the specified attachment.


Parameter(s):

NameTypeMandatoryDefault Value
attachmentIDStringYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

deleteAttachment
let attach = new SimpleAttachment();
attach.deleteAttachment('157052637119478714');

getContent(SimpleRecord sysAttachment)

This method gets attachment content as a string.

NameTypeMandatoryDefault Value
sysAttachmentSimpleRecordYN

Return:

TypeDescription
StringThe attachment content as a string.

rename(attachmentId,fileName)

This method renames the specified attachment.


Parameter(s):

NameTypeMandatoryDefault Value
attachmentIdStringYN
fileNameStringYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

rename
let attach = new SimpleAttachment();
attach.rename('157052637119478714', 'new_name_1.png');

write(SimpleRecord record, String fileName, String contentType, String content)

This method inserts the attachment to the record specified.

NameTypeMandatoryDefault Value
recordSimpleRecordYN
filenameStringYN
contentTypeStringYN
contentStringYN
  • No labels