+ Start a Discussion
❤Code❤Code 

Inequality operator not allowed for this type: wrapperOrder(wrapper class)


0down votefavoriteI have a wrapper class variable as -
map<String,wrapperOrder> workOrderNameToSumMap = new map<String,wrapperOrder>();
When i am trying to assign to a string variable i am getting error
String maxKey = workOrderNameToSumMap.isEmpty()?null:new List<String>(workOrderNameToSumMap.keyset())[0]; for(String s1:workOrderNameToSumMap.keySet()) { maxKey = workOrderNameToSumMap.get(s1)>workOrderNameToSumMap.get(maxKey)?s1:maxKey; }

Error -
Inequality operator not allowed for this type: wrapperOrder

 
Temoc MunozTemoc Munoz
HI.

This part will not work:
workOrderNameToSumMap.get(s1) > workOrderNameToSumMap.get(maxKey)

workOrderNameToSumMap.get(s1) will give you a wrapperOrder object not a Number. Same for workOrderNameToSumMap.get(maxKey).

Either you have a numeric value in your wrapper (i.e. wrapperOrder.myValue) or you meant to grab the String value of the map and type cast it to a number)