function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michele ToscanoMichele 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?  
Best Answer chosen by Michele Toscano
Iryna ZasikanIryna Zasikan
variable name cannot start from number

All Answers

Apoorv Saxena 4Apoorv Saxena 4
Hi Michele,

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
Iryna ZasikanIryna Zasikan
variable name cannot start from number
This was selected as the best answer
Michele ToscanoMichele Toscano
Thank you Iryna and Apoorv, I used both answers and it is working now.  Very good information.