Is there a way to increase the value on the map without requiring a second variable?
for example, this does not work:
counts = new Map<string,integer>(); counts.put('month_total',0); counts.put('month_total',counts.get['month_total']++);
it returns "The initial term of the field expression must be a specific SObject: MAP"
instead, I needed to do:
counts = new Map<string,integer>(); counts.put('month_total',0); integer temp = 0; temp++; counts.put('month_total',temp);
Is there any way to increase without requiring an extra variable?
source share