NextGen Knowledge Center

Examples

Modify a previously attached CCD attachment:

var ccd = new XML(getAttachment(attachmentId, true).getContentString());

ccd.id.@root = 'testing';

updateAttachment(attachmentId, ccd.toString(), 'text/xml', true);

Read in a PDF from the filesystem and add it as an attachment:

var fileBytes = FileUtil.readBytes('/path/to/file.pdf');

// Pass in true for Base64Encode, since the content isn't already Base64 encoded
addAttachment(fileBytes, 'application/pdf', true);