Establecer como favoritoYeturu Srikanth (bigworks) ha preguntado en #Apex21 may 2020, 14:47what to write in anonymous block for this code to execute..? i am not getting please helpm me in thiscode public class AddPrimaryContact implements Queueable { private Contact s; private String State; public AddPrimaryContact(Contact s, String State) { this.s = s; 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> con = new List<Contact>(); for(Account acc: ListAccount) { Contact cont = s.clone(false,false,false,false); cont.AccountId = acc.id; con.add( cont ); } insert con; }}what to wrire here in anonymous block ..?AddPrimaryContact obi = new AddPrimaryContact(s,usa);Database.executeBatch(obj); Mostrar más3 respuestasOrdenarOrdenar por fechaOrdenar por más útilOrdenar por fechaCargar más comentarios...agustin blanco (Salesforce)21 may 2020, 15:14yes, you need to also create the contact and the state, for exampleSystem.enqueueJob(new AddPrimaryContact(new Contact(LastName='test'),'usa'));if it helps please like or mark as correct, it may help othersAgregar un comentarioEscribir una respuesta...NegritaCursivaSubrayadoTachadoLista con viñetasLista numeradaAgregar vínculoBloque de códigoInsertar imagenAdjuntar archivosURL de vínculoCancelarGuardar0/9000Responder
agustin blanco (Salesforce)21 may 2020, 15:14yes, you need to also create the contact and the state, for exampleSystem.enqueueJob(new AddPrimaryContact(new Contact(LastName='test'),'usa'));if it helps please like or mark as correct, it may help others