Hi Anila, Below query will reutn you total bytes of file storage for a particular object, please repace opportunituy in below code with your object name
Use this link for more info on attachment object : https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
Use this link to convert byte into GB : http://www.matisse.net/bitcalc/?input_amount=1&input_units=bytes¬ation=legacy
SELECT count(BodyLength) FROM Attachment WHERE Parent.Type='Opportunity'
Hi Anila, Below query will reutn you total bytes of file storage for a particular object, please repace opportunituy in below code with your object name
Use this link for more info on attachment object : https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
Use this link to convert byte into GB : http://www.matisse.net/bitcalc/?input_amount=1&input_units=bytes¬ation=legacy
SELECT count(BodyLength) FROM Attachment WHERE Parent.Type='Opportunity'
That’s my understanding as well, if you have more than 50K attachments for your object, you can alternatively use data loader to export attachment records to excel, sum total body length and convert it to GB
SELECT count(BodyLength) FROM Attachment WHERE Parent.Type='Opportunity' would return the number of attachments per object. In order to get the total size of the attachments per object SELECT sum(BodyLength) FROM Attachment WHERE Parent.Type='Opportunity'
Below query will reutn you total bytes of file storage for a particular object, please repace opportunituy in below code with your object name
Use this link for more info on attachment object : https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
Use this link to convert byte into GB : http://www.matisse.net/bitcalc/?input_amount=1&input_units=bytes¬ation=legacy
Thanks,
Fahad Akhtar
All Answers
Use bodyLenghth keyword to get the size of attachment.
Let me know if you have any questions.
Below query will reutn you total bytes of file storage for a particular object, please repace opportunituy in below code with your object name
Use this link for more info on attachment object : https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm
Use this link to convert byte into GB : http://www.matisse.net/bitcalc/?input_amount=1&input_units=bytes¬ation=legacy
Thanks,
Fahad Akhtar
In order to get the total size of the attachments per object
SELECT sum(BodyLength) FROM Attachment WHERE Parent.Type='Opportunity'