+ Start a Discussion

autopopulate a lookup field based on the value of another lookup field

I have a custom object called Policies which has a lookup field to Contacts. 

In the Case object, I have created a lookup field to Policies. When a user inputs the Policy number I'd like the Case Contact Lookup field to auto populate with the Contact name related to that policy number. 

Can anyone help me with the code for this? Also, if I introduce a trigger on the Case record, will this have an affect on my email to case function. I had configured a Lookup filter on the Contact lookup field which prevented the email to case from working. So I had to remove it. 
SandhyaSandhya (Salesforce Developers) 

Please refer below links for similar discussion you will get some information.

Hope this helps you!

If this helps you mark it as solved.

Thanks and Regards
Hi Sandhya,

Thanks for that. I had already found those solutions online but they do not help me. I am a beginner when it comes to apex and triggers. I know how to create a trigger but understanding the code is a bit over my head at this stage.