Need help understanding how Event Receivers work while referencing multiple lists.
I have a document library, called 'Emails'. On an Email object, I have a lookup field called 'Candidate'. I have another list called 'Candidates' (which 'Candidate' field looks up to). A Candidates object has an 'email address' text field.
I have setup an EmailReceived Event Receiver, and I am able to extract the desired metadata information.
What I want to achieve is that when an Email is received, look through the 'Candidates' list and find any items in the list where their 'email address' field matches the EmailReceived 'sender' field item.
If a match is found, assign the Candidate lookup ID value to the email object 'Candidate' lookup field.
So my goals are
- A way to search through List B from within a ER of List A (doing a 'foreach' loop Im assuming, looking for a field match)
- If match is found, update lookup field in list A with ID of matched object from list B
Thanks for any guidance!