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
narendevnarendev 

condition to not enter duplicate names in salesforce

HI

 

I need to specify (a condition to not enter duplicate names in salesforce)for standard field object Account,

through validation rules (or) any way in Admin part not through coding(Triggers should not be used).

 

please help me out.

 

Narendra 

Best Answer chosen by Admin (Salesforce Developers) 
SeAlVaSeAlVa

You will need to do the following.

1. Create a Text-field, set as unique and don't display it on the layout.

2. Create a workflow rule that triggers on "create or update" and set the condition formula to "True".

3. Associate a field-update to the workflow created on step 2, that updates the field created on step 1 with the standard field you want to make unique.

 

Regards.

All Answers

AravindBabu512AravindBabu512

Hi,

 

We do have Appexchange apps to do this if you do not want to write any code to achieve this. Other than that there is no option. You can create another text field, make it unique and have the default value as "Account.Name" but unfortunately salesforce does not provide this option, it doesn't lets you to have a dynamic value as default, and if you use a formula field to have the "Account.Name" there cant be any validations written for this unless you are ready to have some code written. So Appexchange is what i would prefer.

 

Thanks,

Aravind

SeAlVaSeAlVa

You will need to do the following.

1. Create a Text-field, set as unique and don't display it on the layout.

2. Create a workflow rule that triggers on "create or update" and set the condition formula to "True".

3. Associate a field-update to the workflow created on step 2, that updates the field created on step 1 with the standard field you want to make unique.

 

Regards.

This was selected as the best answer
JitendraJitendra

Hi,

 

You can create a validation rule using VLookup Function to check whether name already exist in account or not.

SeAlVaSeAlVa

Hi Jitendra,

the problem of using VLookup solution is that it will not be triggered on undelete, so if you create an account A, delete it, create another account A, and then you undelete the first one, you will have duplicated values.

 

JitendraJitendra

Yeah.. I missed that. Thanks.

SeAlVaSeAlVa

No problem, I'm just trying to avoid someone else having the same issue I had a while ago. :P

narendevnarendev

Thanks

 

 

For your reply seAIVa.

 

 

C Narendra Reddy

+91-9849896921 

narendevnarendev

Hi SeAIVa

 

I have some problem  with step 3. 

 

What is the condition to be given in Rule Criteria,(i mean after selecting-- Formula evaluates to true),the condition with insert field and insert operator. I crated a field name (dupacc) and made it invisable using pagelayout.

 

Please give me some clarity in field update in step-3.

 

C Narendra

 

 

 

 

SeAlVaSeAlVa

While creating the workflow rule, after choosing the object....

-----------------------

Evaluation Criteria: Every time a record is created or edited

Run this rule if the following [formula evaluates to true]:

True

[Save & Next]

------------------------

 

By setting the formula criteria to [true], you make the workflow get triggered every-time someone touches a record.

Then, by creating a "Field Update" associated, you make sure your unique field has the value you want to make unique.

And the field it-self assures that.

 

You can try to make the condition more specific by using 

OR(ISNEW(),ISCHANGED(XXXX))

 

(replace "XXXX" by the value you want to make unique (not dupacc, but Name, or something like that))

 

narendevnarendev

Hi SeAIVa

 

Thanks For Your Reply.

 

In Field Update,after specifying Object and Field to Update,should i mark (Re-evaluate Workflow Rules after Field Change).

 

And what about the section(Specify New Field Value) should i give any formula.

 

with out doing these two i've saved and checked but still duplicate records are inserted.

 

The other condition u mentioned is for workflow instead of giving True na.

 

sorry yar for interrupting.

 

C.Narendra.

 

narendevnarendev

Hi SeAIVa

 

Thanks For Your Reply.

 

In Field Update,after specifying Object and Field to Update,should i mark (Re-evaluate Workflow Rules after Field Change).

 

And what about the section(Specify New Field Value) should i give any formula.

 

with out doing these two i've saved and checked but still duplicate records are inserted.

 

The other condition u mentioned is for workflow instead of giving True na.

 

sorry yar for interrupting.

 

C.Narendra.

 

SeAlVaSeAlVa

"And what about the section(Specify New Field Value) should i give any formula."

 

Yes, you should write there the original field that you want to make unique ("Name", for example)

narendevnarendev

Hai SeAIVa

 

Thanks for your Reply to my Query,i have solved it.

Will  you please help me out with this problem. 

 

For a Account,When Rating -----> Cold is selected for a record the edit mode should be disabled(ie the record should not edited).This should be achived by using Workflow,which Workflow Action should i select,and what is the condition to be specified.

 

Please help me out with this problem.

 

C Narendra

+91-9849896921

 

narendevnarendev

Hai SeAIVa

 

Thanks for your Reply to my Query,i have solved it.

Will  you please help me out with this problem. 

 

For a Account,When Rating -----> Cold is selected for a record the edit mode should be disabled(ie the record should not edited).This should be achived by using Workflow,which Workflow Action should i select,and what is the condition to be specified.

 

Please help me out with this problem.

 

C Narendra

+91-9849896921

SeAlVaSeAlVa

Can't you create a validation rule using PRIORVALUE and ISPICKVAL ?

narendevnarendev

Hai,

 

What is the condition to be given in validation rule using PRIORVALUE and ISPICKVAL, not to edit the record.

 

 

C Narendra.