Print

CreateAttachmentFromBase64

CreateAttachmentFromBase64() function takes a content encoded as Base64 string and creates a new file in the given case. This file may be placed on the case attachemnt list or in some document-type field on the case form.

Syntax:

CreateAttachmentFromBase64(base64String, attachmentName, caseId);
CreateAttachmentFromBase64(base64String, attachmentName, caseId, fieldName);

Arguments:

  • 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.

Return Value:

Returns true if an attachment was created, otherwise returns false.

Type: Boolean

Examples:

Example 1:

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.

Example 2:

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.

Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?