You need to sign in to do that
Don't have an account?
Custom Link to run batch APEX job?
I have a very simple command that I plug into the Develope Console and it works great.
batchMaintenanceCalculator b = new batchMaintenanceCalculator(); database.executeBatch(b,25);I'ld like to figure out a way that I can create a url that will do the same. So other users can execute without the Developer Console
http://sfdcintegration.blogspot.in/2014/01/execute-batch-apex-from-java-script.html
You can batch job below java scipt button.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var scr="batchMaintenanceCalculator c = new batchMaintenanceCalculator (); " +
" Database.executeBatch(c, 5); ";
var result = sforce.apex.executeAnonymous(scr);
alert("The Batch is Running");
Please let us know if this will help you.
Thanks,
Amit Chaudhary
amit.salesforce21@gmail.com
All Answers
http://sfdcintegration.blogspot.in/2014/01/execute-batch-apex-from-java-script.html
You can batch job below java scipt button.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var scr="batchMaintenanceCalculator c = new batchMaintenanceCalculator (); " +
" Database.executeBatch(c, 5); ";
var result = sforce.apex.executeAnonymous(scr);
alert("The Batch is Running");
Please let us know if this will help you.
Thanks,
Amit Chaudhary
amit.salesforce21@gmail.com
I never tried this. But just a thought.
Create a simple VF page like below
Create BatchMaintenanceCalculatorExecute class
Now you have two options to run this
1) Create a Visualforce Tab for above VF page and grant the tab premission to the profiles
2) Create a Custom Link Setup->Customize->Home->Custom Link. Your VF page will be the Content Source for this Custom Link. Display this link in the sidebar component
Let me know if it helps.
Regards
Amrender