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
Subhan PothakamuriSubhan Pothakamuri 

How to know the size of attachments of Lead Object

Hi All,

The salesforce standard lead object has 50000 + records in salesforce. I can get the size of the leads records by checking the storage usage under Data Management setup. Is there anyway to know the total attachments size in salesforce for the lead object also.

 
JLA.ovhJLA.ovh
You could run this SOQL query
select sum(BodyLength) from Attachment where parentid in (select id from Lead)

 
Subhan PothakamuriSubhan Pothakamuri
Hi,

The above mentioned query is working fine for the leads where the converted flag is false. it is not considering the records where the lead converted flag is true. Id there anyway to get those records data also