+ Start a Discussion
the0nly0nethe0nly0ne 

What is the maximum number of characters for Apex?

I am getting ready to begin an Apex project that involves very complex business logic. I am currently sitting on about 10,000+ characters (which I realize is not too high), but I expect to have a whole lot more before my project is finished.

 

I was curious as to what the character limit is for one Apex trigger. This will help me decide whether to proceed with only one trigger, or to find an alternate method of specifying the necessary logic.

 

Thank you, in advance!

Best Answer chosen by Admin (Salesforce Developers) 
paul-lmipaul-lmi
100,000 chars per class, and 1MB total for all classes.

All Answers

the0nly0nethe0nly0ne
Never mind, I was able to find that there is a 100,000 character limit on Apex scripts. Please let me know if this is incorrect, though. Thank you.
sforce2009sforce2009
Yes that is right that there is a limit on script. you will hit a script too long exception when you try to save it after that limit. resolution is to use more number of classes (global classes etc)
paul-lmipaul-lmi
100,000 chars per class, and 1MB total for all classes.
This was selected as the best answer
admintrmpadmintrmp

Is it possible to extend this in the future if we need to?

 

If so, it doesn't apply to installed applications does it? Just when developing? So you can install as many apps as you want without increasing the your usage??? Is that right?

Message Edited by admintrmp on 11-19-2009 05:07 AM
Alexis MassonAlexis Masson
Update 2018 - 1M for Apex Triggers, 1M for Apex Class
6 mega for the whole Apex Code of your org.