I have a method in apex class
public static void test(List<contact> newOppProdList,Map<Id,contact> oldOppProdList){
List<test__c> testprod= [Select Id,name from test__c];
for(test__c objProjectProd : testprod){
code operations here}
I am transferring the method to queuable apex class:
public class Queueabletest implements Queueable {
public void execute(QueueableContext context) {
I am replacing the query here.
List<test__c> testprod= [Select Id,name from test__c];
return testprod;
}
can i remove the method query in apex class method and i can use same testprod variable in that method ,it will work? and then method parameter values (List<opportunitylineitem> newOppProdList,Map<Id,opportunitylineitem> oldOppProdList)
is coming for the input as trigger in both after insert and after update.
How can i give the input for queuable class?
for after insert, contactTriggerHandler.test(trigger.new,null);
for after update, contactTriggerHandler.test(trigger.new,trigger.oldMap);