+ Start a Discussion
kumgaurav1.3959431011250151E12kumgaurav1.3959431011250151E12 

Object comparison design pattern

Hello Everyone,
Appreciate if you can answer me yes or No. I have an custom object with field address, city, state and zip(with some additional fields). Can i override object compare to method to compare only these fields and says object is duplicate or not.  Or do I need to create custom wrapper class ?
lifewithryanlifewithryan
I had to do something like this in a standalone/warpper class that implements Comparable. I don't think you just outright override it.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_comparable.htm
kumgaurav1.3959431011250151E12kumgaurav1.3959431011250151E12
Thank you Ryan.
lifewithryanlifewithryan
Hope you get it figure out. :)