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
Arun ViswanathanArun Viswanathan 

How to run Apex command?

I'm looking to update a calculation for a large number of fields and have an APEX command line.  I have some base instructions to go to Setup --> Developer Console --> Debug --> Open Execute Anonymous Window.  This is where I get stuck and not sure what the syntax is.  This is the command line I have to run:

database.executebatch(new XXXX_YY_AAA_YTD_CALC (),200);

And i believe the class is: XXXX_YY_AAA_YTD_CALC

So what would the syntax be that I drop into the box that pops up for me to execute?  Is it as simple as just entering in one line of database.executebatch(new....)

Thanks,
Arun
Best Answer chosen by Arun Viswanathan
Saurabh BSaurabh B
Hi Arun, looks like you are trying to call Batch Class from Execute Anonymous Window. Assuming name of your Batch class is "XXXX_YY_AAA_YTD_CALC", it would look like this,
 
XXXX_YY_AAA_YTD_CALC b = New XXXX_YY_AAA_YTD_CALC ();
database.executeBatch(b,200);

Please mark this as Best Answer if it helps you!

All Answers

Saurabh BSaurabh B
Hi Arun, looks like you are trying to call Batch Class from Execute Anonymous Window. Assuming name of your Batch class is "XXXX_YY_AAA_YTD_CALC", it would look like this,
 
XXXX_YY_AAA_YTD_CALC b = New XXXX_YY_AAA_YTD_CALC ();
database.executeBatch(b,200);

Please mark this as Best Answer if it helps you!
This was selected as the best answer
Arun ViswanathanArun Viswanathan
Thank you Saurabh!  Yea i changed out the exact name of the class for privacy reasons to those random letters but will give it a shot.  Thank you