You need to sign in to do that
Don't have an account?
Vidya H 4
I have a text field on Account that is "Primary contact". User should not be able to delete the Primary Contact.I need to achive this by triggers
Need to trigger with handler class.
I have a text field on Account that is "Primary contact"(text field) where you will give the related contact name of that particular account, which ever contact name is given in that field shouldn't be able to delete by any user.
ex - if account A has 2 related contacts i.e, c1 and c2.
now i will update that Primary contact field with related contact c1.
now any user should not be able to delete that C1 related contact.
I have a text field on Account that is "Primary contact"(text field) where you will give the related contact name of that particular account, which ever contact name is given in that field shouldn't be able to delete by any user.
ex - if account A has 2 related contacts i.e, c1 and c2.
now i will update that Primary contact field with related contact c1.
now any user should not be able to delete that C1 related contact.
You can use the below trigger and hanlder.
If this solution helps,Please mark it as best answer.
Thanks,
All Answers
You can use the below trigger and hanlder.
If this solution helps,Please mark it as best answer.
Thanks,
Did you replace the field API name of primary contact at all the places.Are you facing any errors or you are able to delete the contact even you have the name. Can you also provide the Contact Name and primary contact name in account screenshots.
Thanks,