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
Bhup@esplBhup@espl 

How can I update Lead when we throw the error from lead Trigger.

Hello,

 

I need to Prevent duplicate lead on Email address and need to update count on Lead.(i.e. a duplicate lead comes 4 time then only first should be inserted and first lead reacord there are a custome field Name Duplicate Count it should be 4.

 

Means We need to update Lead when we throw the error from lead Trigger.

 

Thanks in advance. 

vriavmvriavm

You may try catching the error/exception and do your update in the catch block.