function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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. :)