0
votes

Our order DB is trying to send to SF orders via e-mail service to customer object. Because of SF daily limits of 5,000 for our org and > 5,000 orders on some days, we adjusted the code to where we can get > 1 order in one e-mail.

The issue is that 1-10 orders within one e-mail work fine. If > 10, then no-joy. Can't find anywhere in the code where this would happen.

The code block is rather large, so here is a .txt to the file. ..this is the apex class associated with the e-mail service.

https://www.dropbox.com/s/rz5zbhf7q7yku0w/apex.txt

Thanks so much!

1

1 Answers

1
votes

Although I can't be specific without running your code, I'm inclined to think that you're hitting a governor limit, either

1) The limit on the number of queries run — you have a lot of SOQL queries inside the main loop

2) The total number of script statements executed — less likely but you are doing a lot of processing on fields etc..

I would run this code from execute anonymous providing it with dummy data, that way you should see an error message if you're hitting one of the above limits.