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
harry63harry63 

deduplication account

hi all

i am trying to write dedupliaction trigger on account based on account name and billingcity.can anyone give trigger code. issue:if any user try to enter same account name and city it should generate an error.

thanks in advance

iBr0theriBr0ther

You can use external id + workflow-field update ( account name + billing city);

So no trigger is needed.

 

Cheers,

harry63harry63

hi rhi thanks for replying me..if you dontmind could you post the sollution...

iBr0theriBr0ther

Well, let me try to show you:

The idea is just to copy account name and city to the unique field. If unique field gets the same account + city,...  this is what you want, right  ?

 

  - Create a text field on account and mark it as Unique

  - Create a workflow rule:

         + Rule = OR(ISCHANGED( Name ) , ISCHANGED( BillingCity ))

         + Evaluation Criteria = Every time a record is created or edited

  - Create a workflow action as field update.

         + choose your new unique field

         + Formula = Name + City

 

So unique field will not allow you to input the same value.

Hope this help.

 

Cheers,