CreateAttachmentFromBase64(base64String, attachmentName, caseId); CreateAttachmentFromBase64(base64String, attachmentName, caseId, fieldName);
- base64String – (String) a content encoded as base64 that must be saved as a file;
- attachmentName – (String) a name of the newly created attachment/file;
- caseId – (Decimal) ID of the case where the newly created file will be added to;
- fieldName – (String) [Optional] a name of the document-type field on the given case where the newly created file will be added to.
Returns true if an attachment was created, otherwise returns false.
CreateAttachmentFromBase64("SGVsbG8gV29ybGQhISE=", "myAttachment.pdf", [CaseId]);
This will create a new attachment with the given content and the file name. The function then will add the created file into the list of the attachments on the current case, because the variable [CaseId] returns by default ID of the current case.
CreateAttachmentFromBase64([base64String], "myAttachment.txt", 123, "myField");
This will create new attachment with the given content from the „base64string” field on the case form and add the attachment as a document to the field „myField” on the case which ID equals to 123.