You need to sign in to do that
Don't have an account?
Import bulk csv
Hello,
I am importing large sets of Data using Batch Apex from visualForce page. I have collected the list value from Class and calling batch apex just to do DML.
Below is my code,
Calling from class :
SPL_BatchImportGild splTar = new SPL_BatchImportGild(FinalTarList);
Database.executeBatch(splTar);
Batch:
global class SPL_BatchImportGild implements Database.Batchable<SObject> , Database.Stateful { global SObject[] queue; // = new list<Cycle_Plan_Target_vod__c>(); global SPL_BatchImportGild(SObject[] recs) { queue=recs; } public static SObject[] start(Database.BatchableContext context) { { // need to pass the Queue value to execute. But showing error message 'Variable does not exist: queue'. } global static void execute(Database.BatchableContext context, SObject[] records) { insert records; } gloBal void finish(Database.BatchableContext context) { }
What could be the reason for this.?
Thanks
Vignesh
Your problem here is that you're trying to access queue value with the start method being "STATIC". This cannot be done like this. So just delete the static key unless you really need this, and in this case you have to provide the queue as argument to the start. But as far as I see, you don't need the static key.
Regards
Mouhamed
All Answers
Your problem here is that you're trying to access queue value with the start method being "STATIC". This cannot be done like this. So just delete the static key unless you really need this, and in this case you have to provide the queue as argument to the start. But as far as I see, you don't need the static key.
Regards
Mouhamed