Any Idea on how to solve this error?
Thankyou!
Map<Integer,Map<String,Decimal>> BERYear = new Map<Integer,Map<String,Decimal>>();
List<Budget_Exchange__c> beList = [Select Code__c, USD__c from Budget_Exchange__c];
Map<String, Decimal> bemap = new Map<String, Decimal>();
for (Budget_Exchange__c b : beList)
{
BERYear.put(b.Fiscal_Year__c,bemap.put(b.Code__c, b.USD__c)); //ERROR HERE
}
Error: Incompatible key type Decimal for Map(Integer,Map(String,Decimal))
Fiscal_Year__c
looks to be type ofDecimal
, while yourMap
requires anInteger
. Change the map intoMap<Decimal,Map<String,Decimal>> and try again. Also make sure to include the field
Fiscal_Year__c` in your query.