You need to sign in to do that
Don't have an account?
Rajesh Annam
Can we call finish() method from outside(seperately)
Hi All,
Can we call finish() method which is part of batch process from outside seperately by creating instance for the class that provide implimentation for all methods in batchable interface. Please provide some valueble information on this. Thanks in advance.
Can we call finish() method which is part of batch process from outside seperately by creating instance for the class that provide implimentation for all methods in batchable interface. Please provide some valueble information on this. Thanks in advance.
You can, however why you need to call finish method as it will automatically call when your execution is over .
You have to create a instance of your class .
Instance of Database.BatchableContext .While calling the method you need to pass the instance of Batachable context .
Eg-BatchClass bcls=new BatchClass();
Database.BatchableContext bc;
bcls.finish(bc);
Your method will execute but in which scenario you need to call this ?
Thanks for the reply, I am newbie here while going through the documents I got this doubt. as per my knowledge a method can be called by creating instance. but this is a batch process where all methods executed automatically.Now its clear on this topic.