Created
September 14, 2018 06:24
-
-
Save deangrant/208da83a7269112c2a9bd60e5ed08b3a to your computer and use it in GitHub Desktop.
setResourceElementMimeType.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retrieves the resource element as a mime attachment from the specified input parameter (resourceElement). | |
var content = resourceElement.getContentAsMimeAttachment(); | |
System.debug('The resource element ' + resourceElement.name + ' has been returned with the mime type ' + content.mimeType) | |
content.mimeType = mime; | |
// Sets the mime attachement to the type specifed from the input parameter (mime). | |
resourceElement.setContentFromMimeAttachment(content); | |
System.log('The resource element ' + resourceElement.name + ' mime type type has been set to ' + mime)]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment