You need to sign in to do that
Don't have an account?
xxyyzz
Dynamically execute batch classes
I have a requirement where I need to be able to pass the name of a batch apex class to a function as a string. The function will then call Database.ExecuteBatch using the string as the name of the class.
E.G.
public void executeBatch(String className, String parameter1){ //This is where I am stuck className classToExecute = new className(parameter1); Database.ExecuteBatch(classToExecute, 5); }
How do I dynamically create an instance of the class?
I dont think this would be possible in Apex..