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
Ravi Kumar 259Ravi Kumar 259 

how to restric attachment size while i am creating employee object.?

surasura
you can use the BodyLength property of attachment object to determined the size of the attacment and do any size restriction
Ravi Kumar 259Ravi Kumar 259
Hi, Please send me sample code...!
surasura
if(attachment.BodyLength /1000 < limit ) // bodylength returns size in byets so it is devided by 1000 to turn it to Kb
{
   //put error message here 
}
Ravi Kumar 259Ravi Kumar 259
Thanks