You need to sign in to do that
Don't have an account?
Akanksha Cullen
Lookup Field - Restricting Duplicate Value Insertion
Hey,
I need to restrict the user from entrying any duplicate values in the database. I have a Members Object. It has an auto text field and and a member name lookup field which is related to User Object. I don't want any one to pick and add any user from the look field which is already there in my Members list.
So I have not been able to add this rule to my object. I don't want to use any triggeers for this. Validation rules had not enabled to me do this so far. I also tried to add a filter criteria to the lookup filter. It is not letting me compare the values of Current Lookup Member Name field to Current Record Member Name field.
Could anyone please suggest any workaround for this ?
I need to restrict the user from entrying any duplicate values in the database. I have a Members Object. It has an auto text field and and a member name lookup field which is related to User Object. I don't want any one to pick and add any user from the look field which is already there in my Members list.
So I have not been able to add this rule to my object. I don't want to use any triggeers for this. Validation rules had not enabled to me do this so far. I also tried to add a filter criteria to the lookup filter. It is not letting me compare the values of Current Lookup Member Name field to Current Record Member Name field.
Could anyone please suggest any workaround for this ?
You can achive this one by creating a Text(unique) field and a workflow rule.
1. Create a Text field (Unique) on Members Object // Make sure to check unique checkbox while creating text field.
2. Create a workflow rule with below things
Evaluation Criteria: created, and every time it’s edited
Rule Criteria: Criteria are met
Record: Created Date Not Equal to Null
3. Add a workflow field Update Action
In action insert/update new Text field with member name lookup field which is related to User Object.
Actually we have created Text field for unique values, when ever we create/update Members object records userId will store in our custom Text field, If you select same user second time it throws an error.
Let me know if you have any issues while implementing this.
Best Regards,
Mithun.
All Answers
You can achive this one by creating a Text(unique) field and a workflow rule.
1. Create a Text field (Unique) on Members Object // Make sure to check unique checkbox while creating text field.
2. Create a workflow rule with below things
Evaluation Criteria: created, and every time it’s edited
Rule Criteria: Criteria are met
Record: Created Date Not Equal to Null
3. Add a workflow field Update Action
In action insert/update new Text field with member name lookup field which is related to User Object.
Actually we have created Text field for unique values, when ever we create/update Members object records userId will store in our custom Text field, If you select same user second time it throws an error.
Let me know if you have any issues while implementing this.
Best Regards,
Mithun.
It is possible in Apex trigger, I have the code for restrict the duplicte lookup. If you need let me know.
@Vijay - If the Apex trigger works on the Lookup field, I'd love to have a look at it please.
It will work as per your requirement, actually we need to create a text feild but no need to include that field in your page layout it will insert/update by workflow in background. In Pagelayout/UI your actual lookup field only appear.
Best Regards,
Mithun.
I am sorry for the trouble, I'm just new to Salesforce.
"
Yes Text option, In workflow field update you just select your Members object user lookup field for Text field.
It means, your lookup field and new custom text fields value should be same.
Make sure to activate your workflow before testing.
Best Regards,
Mithun.
Regards,
Ayesha