You need to sign in to do that
Don't have an account?
Vaibhav Babrekar
Please help me on following requirement
ABC Containers require the ability to automatically associate a Contact created in their Salesforce Instance with the respective Account based on the email domain specified in the primary email address of the Contact. The association should happen real time as soon as a Contact record is created within the system.
TODO
•Ensure all the discussed implementation best practices are followed.
•Develop the necessary piece of Apex code to implement a solution for the given problem statement.
•Develop the necessary Test code to attain the right code coverage (minimum 90% with at least 4 test cases)
TODO
•Ensure all the discussed implementation best practices are followed.
•Develop the necessary piece of Apex code to implement a solution for the given problem statement.
•Develop the necessary Test code to attain the right code coverage (minimum 90% with at least 4 test cases)
try with below code.
You can create Domain__c text field on account object and dont add this field in page layout.
Trigger:
Test Class:
If this helps, Please mark it as best answer.
Thanks!!
All Answers
When contact created and contact email matches with account email address then you need to link the contact to account?
Thanks!!
You are right because its given like "based on the email domain specified in the primary email address of the Contact". Can you please provide me the solution for this
Thanks in Advance
The primary contact is linked to an account already??
Thanks!!
If we enter the contact record with primary email as abc@tcs.com, abc@something.com then it should associate contact with Account as TCS or Something with website as www.tcs.com or www.something.com. And if account is not avalable for association then it should be created. Because its mentioned there "The association should happen real time as soon as a Contact record is created within the system".
Thanks in Advance
primary email is a custom field on contact? and domain name is available on website field of an account object?
Thanks!!
You have the website value " www.tcs.com" on account record right??
Thanks!!
No we don't have it. It's blank actually, programmatically we have to fill it in website field on Account object.
suppose I am creating contact whose email is abc@tcs.com then Account of TCS should be created with name "TCS" in association with that contact and website field should be filled with www.tcs.com.
Thank you
try with below code.
you can create Domain__c text field on account object and dont add this field in page layout.
If this helps, Please mark it as best answer.
Thanks!!
Thanks alot for your help, can you please provide me the test code as given in the problem.
Thanks in Advance
try with below code.
You can create Domain__c text field on account object and dont add this field in page layout.
Trigger:
Test Class:
If this helps, Please mark it as best answer.
Thanks!!
Thats awesome and thank you very much for your support.