You need to sign in to do that
Don't have an account?
Michael_Torchedlo
Long Text Area Field - Unique?
Does anyone have a way to make a Long Text Area or Rich Text Area field unique? We have a custom field on a custom object that is slightly longer than a regular text field but I still want to block duplicates.
A possible solution may be preparing a before insert & before update trigger, which copies the long/rich text area value to a background text field you're going to create. This trigger will do the update and trigger the uniqueness criteria of background text field. However, you will need to use only up to the first (or last) 255 characters of your long/rich text area field.
This link may be helpful on this subject: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
All Answers
A possible solution may be preparing a before insert & before update trigger, which copies the long/rich text area value to a background text field you're going to create. This trigger will do the update and trigger the uniqueness criteria of background text field. However, you will need to use only up to the first (or last) 255 characters of your long/rich text area field.
This link may be helpful on this subject: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm