somebody asked me return types in batch apex , should i show this to him for searching answer for his question? ... if u Dont mind tell me the clear answer...
ID batchprocessid = Database.executeBatch(reassign);
AsyncApexJob aaj = [SELECT Id, Status, JobItemsProcessed, TotalJobItems, NumberOfErrors
FROM AsyncApexJob WHERE ID =: batchprocessid ];
Hi All, Following is the link : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm which is the answer to the question, which is List of sObject which a Start method in Batch Class returns...
How is the Start method able to return two different return types? Iterable or QueryLocator.
As far as Function Overloading is concerned, methods can be overloaded based on different input parameters. But its not possible to overload a method based on different Return Types.
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
The Database.executeBatch method returns the ID of the AsyncApexJob object, which you can use to track the progress of the job. For example:
If you are looking for Batchable Interface Method return type
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_database_batchable.htm
Public System.Iterable start(Database.BatchabelContext bcon)
Public Database.QueryLocator start(Database.BatchabelContext bcon)
Public void execute(Database.BatchableContext bc,List<Sobject> scope)
Public void finish(Database.BatchableContext bc)
Let us know if this will help you
Thanks
Amit Chaudhary
Following is the link : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm
which is the answer to the question, which is List of sObject which a Start method in Batch Class returns...
As far as Function Overloading is concerned, methods can be overloaded based on different input parameters. But its not possible to overload a method based on different Return Types.