Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. system.debug([select code__c from user Limit 1].code__c)
  2. //Output -> 4
  3.  
  4. Criteria value = criteriaObj.Value__c //which is mentioned as 4
  5. //After changing above record value from 4 to 4.0 then it goes fine.
  6. userFieldValue = string.valueOf(userObj.get('Code__c'));
  7. if(criteriaValue == userFieldValue )
  8. {
  9. criteriapassed =true;
  10. }
  11.  
  12. Criteria value = criteriaObj.Value__c //which is mentioned as 4
  13. //After changing above record value from 4 to 4.0 then it goes fine.
  14. userFieldValue = string.valueOf(Integer.valueOf(userObj.get('Code__c')));
  15. if(criteriaValue == userFieldValue )
  16. {
  17. criteriapassed =true;
  18. }
  19.  
  20. if (criteriaObj.Value__c == userObj.Code__c)
  21. // do stuff
  22.  
  23. public static String getIntegerRepresentation(Decimal value)
  24. {
  25. return (value == null) ? null : String.valueOf(value.setScale(0));
  26. }
  27.  
  28. // later...
  29.  
  30. String criteria = getIntegerRepresentation(criteriaObj.Value__c);
  31. String value = getIntegerRepresentation(userObj.Codee__c);
  32. if (criteria == value)
  33. // do stuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement