You need to sign in to do that
Don't have an account?
Help with Multi Layer List
I have a page and class that I have written the end user will select an account. Which creates a Parent Interaction on the Interaction Object. From there, the end user can creat multiple interaction activities associated to the Parent Interaction. I need to associate Interaction Participants (many) to the Interaction Activity and then save the participants (on object Interaction_Participants). Different Particpants can be selected per each Interaction Activity. The Participants need to be selected from the Contacts associated to the Account that was selected at the beginning. However, I am struggling with this last piece. Below is my class. I have stripped everything associated to Interaction_Participants out as it is erroring no matter what I try. Any help isappreciated. I'm running up a deadline and this is driving me nuts.
public class InteractionsController { /*------------------------ Private Variables ------------------------*/ private Map<String, List<Interaction_Activity__c>> IAMap = new Map<String, List<Interaction_Activity__c>>(); private List<Interaction_Activity__c> pInt = new List<Interaction_Activity__c>(); private List<Interaction_Participant__c> IP = new List<Interaction_Participant__c>(); private String retUrl; public Interaction__c InteractionRequest {get; set;} integer cnt = 0; /*------------------------ Consructor ------------------------*/ public InteractionsController() { ID accountId = ApexPages.currentPage().getParameters().get('accountId'); InteractionUtil IntU = new InteractionUtil(); InteractionRequest = IntU.queryInteraction(accountId); InteractionRequest = new Interaction__c(Account__c =accountId); if (accountId != null) retUrl = '/' + accountId; } public List<Interaction_Activity__c> IA { get { return pInt; } private set; } /*------------------------ Private Methods ------------------------*/ public PageReference Ints() { return Page.Interactions; } public PageReference addCreate() { insert pInt; cnt = cnt + 1; return null; } public PageReference addActivity() { if(cnt == 0) { insert InteractionRequest; pInt.add(new Interaction_Activity__c(Interaction__c=InteractionRequest.id)); insert pInt; cnt = cnt + 1; return null; } else { upsert InteractionRequest; pInt.add(new Interaction_Activity__c(Interaction__c=InteractionRequest.id)); upsert pInt; return null; } } public PageReference submit() { upsert pInt; return null; } public void addrowIA() { pInt.add(new Interaction_Activity__c(Interaction__c=InteractionRequest.id)); } }