c_SSPAttachmentService

Methods


<static> copyAll( sourceTable, sourceDocumentId, targetTable, targetDocumentId ) → {Array.<string>}

Description

Copy all attachments from one document to another

Parameters
Name Type Description
sourceTable string
sourceDocumentId sys_id
targetTable string
targetDocumentId sys_id
Returns

<static> getAttachments( table, documentId ) → {Array.<Attachment>}

Description

Get all attachment meta for a table and documentId

Parameters
Name Type Description
table string
documentId sys_id
Returns

<static> getContent( sysId ) → {string}

Description

Get the Base64 encoded content

Parameters
Name Type Description
sysId sys_id
Returns

<static> attach( table, documentId, filename, contentType, base64Content ) → {boolean}

Description

Create/Attach a file to an existing record, this will not work with temp tables

Parameters
Name Type Description
table string
documentId sys_id
filename string
contentType string
base64Content string

Base64 encoded data

Returns

<static> remove( sysId )

Description

Removes an attachment from the system

Parameters
Name Type Description
sysId sys_id

<static> removeAll( table, document )

Description

Remove all attachments for a table and document id (used in clearing temp attachments on the portal)

Parameters
Name Type Description
table string

Table name of the source document

document sys_id

Identifier of the source document


<static> update( attachment )

Description

Updates the meta for an attachment, as long as its sys_id remains the same and for now we only update the filename

Parameters
Name Type Description
attachment Attachment