To find duplicates of a custom object I planned using Salesforce.com's native Duplicate Management functionality. I was a bit disappointed to see that matching rules are not able to compare Long text field.
In my case
CustomObject__c X and Y are equal if all of its 50 long text attributte fields are equal.
I thought of this workaround but am a bit afraid that this is a bit hacky, has bad performance and other drawbacks:
- Add a
- Add BeforeInsert and BeforeUpdate trigger that uses the Apex Crypto class to create a hashcode out of the 50 long text fields and populate the field
- Add Duplicate rule that only checks for equality of this field.
What do you think?