function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Olivia FordeOlivia Forde 

Can someone tell me what this code is doing - in a Controller

tempListED = [SELECT Id, Market_Item__c, Cost_Price__c, Transfer_Price__c, Effective_Date__c, Transfer_Price_Effective_Date__c, Transfer_Price_Currency__c FROM Effective_Date__c WHERE Market_Item__c = :tempMI.Id];
            for(integer i=1 ; i <= tempListED.size() ; i++ ){
                system.debug(tempListED.size());
                system.debug(numberOfDates.get(tempMI.Business_Unit__c));
                tempED = new Effective_Date__c();
                //tempListED.add(tempED);
                numberOfDates.get(tempMI.Business_Unit__c).add(i+1);
                effectiveDates.get(tempMI.Business_Unit__c).put(i, tempListED[i-1]);
                effectiveDates.get(tempMI.Business_Unit__c).put(i+1, tempED);
pconpcon
It's trying to put an Effective_Date__c mapped to a Business_Unit__c and mapping some weird integer to those dates.  However this will break because tempListED is not populated since it is commented out.