5

I'm working on an Apex class that contains a method annotated with @future. Inside of the method I have a few system.debug statements I'm using to figure out why it's not working. The problem is -- if I run my code via the Developer Console and inspect the execution log, it only shows up about half the time. Why?

9

The problem was -- I was executing anonymous code and checking the "Open Log" option. The call was actually generating two separate logs -- one for the anonymous code, and another for FutureHandler, and one or the other would open randomly. This is what made it seem like it was only working some of the time. So instead, I clicked on the Logs tab in the lower pane of the Developer Console and there they both were. Just make sure you click on the FutureHandler one :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.