How do I pass a value from one method to another. I am using a public list with a {get; set;} but this seems not to be working. What I want to achieve is to loop trough the insert from the first method in the second method.
Code sample
public without sharing class addController {
public List<Contact> contactList {get; set;}
@AuraEnabled
public static void saveContacts(List<Contact> listContact){
Insert listContact;
contactList= listContact;
...
}
@future
public static void createUser(){
for(Contact con : contactList){
.. }
}
}