Large File Support

From 3B Knowledge
Revision as of 15:27, 26 November 2023 by Admin (talk | contribs) (Created page with "== Overview == Version 4.11 of the 3B Onboarding app, a Salesforce native application, marks a significant update with the introduction of large file support. This version enhances the app's capabilities in handling and managing files within Salesforce, specifically allowing for larger files of up to 50MB to be managed efficiently. == New Features and Enhancements == ==== Large File Support ==== The highlight of version 4.11 is the support for large files, enabling use...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Version 4.11 of the 3B Onboarding app, a Salesforce native application, marks a significant update with the introduction of large file support. This version enhances the app's capabilities in handling and managing files within Salesforce, specifically allowing for larger files of up to 50MB to be managed efficiently.

New Features and Enhancements

Large File Support

The highlight of version 4.11 is the support for large files, enabling users to handle files up to 50MB. This is a substantial improvement over previous versions, catering to the needs of businesses dealing with larger datasets and documents.

New Token Generation Process

A new token generation process has been introduced in this version. This process is crucial for the new large file support feature, as it allows the app to retrieve and save larger files more effectively.

Initial Configuration Changes

For the initial setup, system administrators must now populate new fields in the existing custom setting b3o__Onboarding_Default_Settings__c. These fields are:

  • b3o__API_Username__c
  • b3o__API_Password__c
  • b3o__API_Token__c

These fields should contain the credentials of an API User or System Administrator.

New Functions in GeneralUtils/services/data.js

Two new functions have been added to the GeneralUtils/services/data.js global static resource. These are critical for the functionality of the large file support:

getFile: This function allows the retrieval of files from Salesforce. It accepts parameters such as contentDocumentId and contentVersionId, with the latter being optional for fetching the latest version of a file.

await getFile({
    contentDocumentId: // Content Document Id to get
    contentVersionId: null // Get latest version if left null
})

saveFile: This function enables saving or updating files in Salesforce. It takes parameters like recordId, pathOnClient, fileData, fileName, and an optional contentDocumentId for updating existing files.

await saveFile({
    recordId: // parent salesforce record
    pathOnClient: // file name with file extension
    fileData: getBase64Content(),
    fileName: // filename
    contentDocumentId: // optional, updates the file if provided
})