You need to sign in to do that
Don't have an account?

Is it possible to have multiple Batch Apex classes on the same object?
Hi,
I have 2 Batch Apex classes that update contact records. Now, I'm trying to write the test method for both, and it seems that when I attempt to simulate the batch job for either job, the other batch job runs as well and I get a runtime error. If I comment out one of the jobs, then other job runs fine and I get 100% coverage (on that particular batch apex job).
Is there anything in particular that I need to do to be able to test multiple Apex jobs?
Thanks in advance.
Hi,
Both Batch Apex jobs are triggered by the scheduler. Originally, I was creating a constructor (for my Batch Apex class) and passing the query as parameter within the constructor. When I did this, I was getting a runtime error on my test class. I decided to get rid of the constructor w/ the parameter, and now all it's good.
I need to understand why it didn't work w/ the constructors, but I think I'll do that once I have some free time :-) Thanks for checking into this though.