• Kris Kargon
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
i have a Agent type picklist and a Agent Name lookup. How do i retrieve Agent Name for each Agent Type ?

Hello, everybody!

 

Again, i'm here to do some questions...

 

I have the following code...

 

public Map<String,Double> calculaFaturamentoMensal(){

		Double soma; 
		
		Map<String,Double> faturamentoMensal = new Map <String,Double>();
		
		for(MovimentoMes__c movimento : 
                   [Select m.Valor__c, m.Mes_de_Referencia__c From MovimentoMes__c m]){
			if(faturamentoMensal.containsKey(movimento.Mes_de_Referencia__c)){
				soma = 0;
				soma = faturamentoMensal.get(movimento.Mes_de_Referencia__c);
				soma += movimento.Valor__c;
				faturamentoMensal.put(movimento.Mes_de_Referencia__c,soma);
			} else {				           
                                faturamentoMensal.put
                                (movimento.Mes_de_Referencia__c,movimento.Valor__c);
			}
			
		}
		
		return faturamentoMensal;
	
	}

 

After this, i want to sort my map by the key... trying to ensure that when I iterate over the map ill have the values based on the crescent sequence of the key...

 

Tks for all