You need to sign in to do that
Don't have an account?
One to One relationship between objects (a standard and a custom)
The one solution which worked for me was..
"Create a lookup field on the child
Create a unique field on the child, and hide this field from all page-layouts
Write a workflow, for any change of the lookup field, to copy that value from the lookup field into the unique field
This process has many overheads:
Extra field is required
Unique criteria is utilized (we only get 3 unique fields per object)
Workflow is used"
The only problem is the error message that gets displayed whenever the rule gets broken is out of line because it still refers to the hidden field which seems absurd.
Is there any way to change the pre-defined error message??
PS: I am looking for a one to one relationship between standard object (Users) and a custom object.
You can write a trigger in that case on your custom object.
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
All Answers
You can write a trigger in that case on your custom object.
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Himanshu Parashar, i guess you wanted to write this (existUserIds instead of userIds):
Thank you Bogdan for the correction in Himanshu's code.
Thank you Himanshu. It worked!
I am glad it worked Nidhi. :)
Thanks,
Himanshu
Hi,
Is there a way that I can set focus on user__c when the trigger initiates?
I tried doing it using focus() but seems it does'nt work.