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
DipakDipak 

How to know the size of each record in custom object

Hi ,

 

can any body inform me, the how to know the size of each record in a custom object

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Each custom record should consume 2KB of database storage. A rule of thumb is that 500k records is 1GB of storage. There are a few records that are an exception to this rule (e.g. Campaigns), but all custom objects should follow this logic. It's all in the Help & Training window.

All Answers

Rahul SharmaRahul Sharma

Hi Dipak,

What do you mean by "size of each record in a custom object",

Elaborate a bit so that we can help.

DipakDipak

Hi Rahul,

 

I mean to say the size in KB of the record which are stored in Object.

 

For Example:

 

Lets say a Custom Object named "MyObject" having fields "name", "age", "rollno"

then i inserted record to "MyObject" --> XXX,12,r01

 

i want to know the size of this inserted record (in KB) .... size occupied by this record in memory

Rahul SharmaRahul Sharma

Dipak,

is there any specific requirement for which the object size is needed?

DipakDipak

Hi Rahul,

 

I need to calculate the record size, & when this size exceeds the some specified limit, then old records/data will be deleted .

 

For this delete operation , i will write the apex class code...But now i need to know the size of record..

 

Please help me

sfdcfoxsfdcfox

Each custom record should consume 2KB of database storage. A rule of thumb is that 500k records is 1GB of storage. There are a few records that are an exception to this rule (e.g. Campaigns), but all custom objects should follow this logic. It's all in the Help & Training window.

This was selected as the best answer