New answers tagged

0

There are some basic problem with your code:- You have query inside a for loop. Check these two queries in your code:- Group[] owners = [SELECT Name FROM Group WHERE Id = :uId]; ContentDocumentLink[] files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :pId]; You need to take out these queries outside for loop. Else you will ...


3

Per your comment: [the files] may be on the order of 100-300MB You can't process anything close to that size in Apex. The heap limit for most asynchronous code is 12MB. While in general Apex is poorly suited to processing file data, you can do it by querying the data. For example, to get Content Files', well, content, you can query SELECT VersionData FROM ...


0

Based on comments, You can achieve it using lightning app builder:- Go to your opportunity lightning record page click on edit page by clicking on setup icon on right top of the screen It will open lightning app builder where you can configure the opportunity lightning record page. Now, click on tab component where your details , related and activity tab ...


0

This is how i resolved it: new fflib_SObjectUnitOfWork( new List<Schema.SObjectType> { EVENT_LOG__c.SObjectType, ContentVersion.SObjectType } ); EVENT_LOG__c eventLog = new EVENT_LOG__c() eventLog.Name = 'MyEvent'; .... unitOfWork....


3

If you can upload in binary format, do so. If your source platform cannot use binary, then use base64. Base64-encoded data is approximately 33% larger, meaning longer upload times, more bandwidth used, and a lower maximum file size for non-multipart uploads. You can insert or update blob data using a non-multipart message, but you are limited to 50 MB of ...


0

It seems to work if you insert the ContentDocumentLink like you described above, pointing it to the root library (ContentWorkspace): ContentDocumentLink cdl = new ContentDocumentLink(); cdl.ContentDocumentId = doc.Id; cdl.ShareType = 'I'; cdl.Visibility = 'AllUsers'; cdl.LinkedEntityId = ws.Id; // library (ContentWorkspace) id insert cdl; Then query for the ...


0

You'll need to implement workarounds as of now if you need custom functionality w.r.t uploading files. The max content limit for AuraEnabled methods as mentioned by Pranay Jaiswal is 4MB, which is also reduced when it is encoded into base64 and gives you a final size limit around 1.5 -2 MB that you'll be able to upload. One of the workarounds would involve ...


0

It's ContentVersion object is what you need to update. You can update records of this object via trigger, you will need to update the SharingPrivacy field of this object. Update this field to N for Visible to Anyone With Record Access. This means the file is visible if the user has read access to the record Update this field to P for Private on Records. This ...


Top 50 recent answers are included