You need to sign in to do that
Don't have an account?
Michele Toscano
Expecting a semi-colon , found '01'
Id 01pF000000452WnIAI = Database.executeBatch(new Batch_ExpDate_PricIn(), 190);
The id referenced is correct. What am I doing wrong here?
The id referenced is correct. What am I doing wrong here?
All Answers
If you are trying to execute a batch, you should simple write the following code :
Batch_ExpDate_PricIn ob = new Batch_ExpDate_PricIn(); // creating instance of apex batch class you want to execute
Database.executeBatch(ob, 190);
The Database.executeBatch method returns the ID of the AsyncApexJob object, which you can use to track the progress of the job.
For example:
ID batchprocessid = Database.executeBatch(ob,190);
AsyncApexJob aaj = [SELECT Id, Status, JobItemsProcessed, TotalJobItems, NumberOfErrors FROM AsyncApexJob WHERE ID =: batchprocessid ];
Please mark this question as Solved if this helps you so that others can view it as a proper solution.
Thanks,
Apoorv