Creating a batch job to load test rest callout but getting the error "batchable instance is too big" Here is my code:
public void TestData_CM(integer a){
//this list has 10 possible outcomes of case
List<String> types = type.split(',');
//postBody is a method which grabs all fields on case in json string format. There are some 100000 cases and I need to create call out for all these cases
List<String> bodyList1 = new List<String>();
for(integer i = 0; i< a; i++){
for(String s : types){
String str1 = postBody('ServiceOpen', s, 'Open');
bodyList1.add(str1);
}
}
Database.executeBatch(new caseTriggerBatch(bodyList1));
}
Executing the above using :
postClass c = new postClass();
c.TestData_CM(1000);
I have flex queue enabled so can have 100 batch jobs with holding status. Please share some ideas on this
Thanks