Skip to main content
Hi,

I have a apex batch that is execueted from Schedulre class. Curently I am passing the query from the schduled class in order to limit the records in the test class but I am not sure where is the best place to declare the query, what would be the best practie  ? or Where should I declare the query, in the schedulable class or directly in the apex batch adding a filter as global variable ?

Thanks for you help,

Jeff
3 risposte
  1. 3 lug 2015, 15:36
    Both are good as per salesforce best pratice. But if you will define the query inside the scheduler class like Example 2. Then you can pass the dynamic query according to requirement. 

    So you can try exmple 2.

     
0/9000