• anshul9887
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I am getting this error when i am using for loop for two maps i.e ChildIdMap, PickSumMAp.

 

GETTING ERROR IN THIS PART OF CODE

===================================================Part of Code============

for(Id parentId:ChildIdMap.keyset())
{

for(Id ChildId : PickSumMap.keyset()){

if((ChildIdMap.get(parentId))==ChildId)
{

Decimal d=PickSumMap.get(ChildId);
}

}
}

 

 

============================================ 

===========================Full Controller Class===========================

global static CaseBean[] SuccessRate(){

Decimal CountPick;
Map<Id,CaseBean> caseBeanMap=new Map<Id,CaseBean>();
Map<Id,Integer> countMap=new Map<Id,Integer>();
Map<Id,Map<Id,Decimal>> servCollMap=new Map<ID,Map<Id,Decimal>>();
Map<Id,Id> ChildIdMap=new Map<Id,Id>();
Map<Id,Decimal> PickSumMap=new Map<Id,Decimal>();
Map<Id,Account> parentAccountMap=new Map<Id,Account>([SELECT Id,Name from Account where ParentId=null]);
List<Case> caseList=[SELECT Id,CaseNumber, Reason, Status,c.Account.Grand_Parent_Account__c,CreatedDate,ClosedDate
FROM Case c where reason in ('Bags not delivered','Bin not delivered' ,'Bin not removed','Complaint from customer',
'Complaint from the Council','Customer wants to cancel','Delayed Collection','Missed Collection','Missing Bin')
AND c.account.id !=null AND CaseNumber!=null AND ClosedDate = THIS_YEAR];
List<Service__c> servList=[Select id,Count_of_Pickup_Days__c,s.Customer__r.Name,s.Customer__r.Parent.id, s.Customer__r.Grand_Parent_Account__c,
Status__c,s.Customer__r.Active_Account_Services__c from Service__c s
where s.Customer__r.id!=null AND Count_of_Pickup_Days__c!=null
AND Status__c = 'Active'];

for(Case caseObj:caseList){
ID parentAccountId=caseObj.Account.Grand_Parent_Account__c;
if(countMap.get(parentAccountId)==null)
{
countMap.put(parentAccountId,1);
}
else
{
integer cnt=countMap.get(parentAccountId);
countMap.put(parentAccountId,cnt+1);
}
}
for(Service__c serObj: servList){
ID AccntId=serObj.Customer__r.id;
ID parentAccntId=serObj.Customer__r.Grand_Parent_Account__c;
if(serObj.Status__c == 'Active'){
if(PickSumMap.get(AccntId)==null)
{

PickSumMap.put(AccntId,serObj.Count_of_Pickup_Days__c);




}
else
{
PickSumMap.put(AccntId,serObj.Count_of_Pickup_Days__c);



}
if(ChildIdMap.get(AccntId)==null)
{
ChildIdMap.put(parentAccntId,AccntId);

}
else
{
ChildIdMap.put(parentAccntId,AccntId);

}
}

}

for(Id parentId:ChildIdMap.keyset())
{

for(Id ChildId : PickSumMap.keyset()){

if((ChildIdMap.get(parentId))==ChildId)
{

Decimal d=PickSumMap.get(ChildId);
}

}
}
CaseBean[] beanList=new CaseBean[100000];

}
//System.Debug('---BeanList---'+beanList);
return beanList;
}

 

 

i just want to show it according to parentId having Child records and want count of those child records

 

Need It Urgently

  • August 24, 2012
  • Like
  • 0

Hi Friends,

 

here is my problem

"I want to display Excel data in visualforce page".

could any one please explain me that how to do this?

 

 

Thanks,

Amit Singh