You need to sign in to do that
Don't have an account?
Sindhu1234
Invalid interface: Queueable
I'm on Trailahead challege ,while coding came accross an error says "Invalid interface: Queueable".
Tried using "small q as queueable" but it doesn't resolved.Any clue where i am going wrong
Tried using "small q as queueable" but it doesn't resolved.Any clue where i am going wrong
//Queueable Apex public class AddPrimaryContact implements Queueable { private Contact c; private String state; public AddPrimaryContact(Contact c, String state) { this.c = c; this.state = state; } public void execute(QueueableContext context) { List<Account> ListAccount = [SELECT ID, Name ,(Select id,FirstName,LastName from contacts ) FROM ACCOUNT WHERE BillingState = :state LIMIT 200]; List<Contact> lstContact = new List<Contact>(); for (Account acc:ListAccount) { Contact cont = c.clone(false,false,false,false); cont.AccountId = acc.id; lstContact.add( cont ); } if(lstContact.size() >0 ) { insert lstContact; } } }
I have changed the Version and it got fxed.
All Answers
I tested below code in my org which is working fine Test class
Let us know if this will help you
Thanks
Amit Chaudhary
I have changed the Version and it got fxed.