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
Ankur SrivastavaAnkur Srivastava 

Anyway to generate custom error message for a unique field ?

Can I change the error message displayed below for a unique field ?
duplicate value found: CHW_Member_Number__c duplicates value on record with id: <RecId>
the above message is not user friendly. 
Dilip_VDilip_V
Ankur,

That is not not possible.
If you are using VF page better go for apex:pagemessages else trigger is the only option to customize error message.

Mark it as solved if it helps.

Thanks.
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Sadly, it is not unless you dont make it unique on the field level but use a trigger to make it unique.