function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
challier fabricechallier fabrice 

Is there a maximum object to be stored in one document folder ?

we have (like other people I think) an issue with the storage of EmailMessage.
Therefore, we develop an apex class that will store each EmailMessage (and attachments) within a single document and retrieve if we need to restore the EmailMessage

As we have around 3 millions email, we will create around 3millions documents and I was wondering if there was a limit or recommandation regarding the number of object within a single folder.
This folder will never be directly access , we will only work with the id of the related document.

Thanks for your help
Hi Challier,

if I understood you correctly, u will convert your every email in to a file and you have currently 3 million such emails which is a huge number for Salesforce. You can check the limits for Salesforce Content here:
max # of files is 30,000,000.

And if you will be using the same idea for future email communications, then you should contact SF and ask for limit increase.

Hope this helps.

Cheers, Dev
challier fabricechallier fabrice
Hi Arya,

thanks for your answer, I've seen the limitation on 30 000 000 but the mail wil "only use " 10% of the limitation therefore, we will far away from the limit.

I was a ECM expert before salesforce and we were used no to have more that 50 000 object within a folder (which was also virtual like salesforce). But the reason was to prevent issue while trying to display the content of the said folder. 
In our case , we will never need to try to see the content of this folder. My question was purely technical therefore, I was wondering if there was a limitation to the number of object stored in one folder or not.