title: Trigger to update a custom lookup field on opportunity
body: <p>I created a custom object XtendedUser which has an id and Name. </p>
  
  <p>I created a custom lookupfield on Opportunity called "XtendedUser__c" which links the opportunity to the corresponding XtendedUser record.</p>
  
  <p>Now I made it so that the name of an opportunityowner corresponds to the name of an XtendedUser-record, so I want the trigger to autopopulate the custom lookup field "XtendedUser__c" on the opportunity with the id of the corresponding XtendedUser-record of which the name matches the name of the opportunityowner.</p>
  
  <p>I never wrote a trigger, always worked with workflows and fieldupdates, but I've got to make this work. So if you could please help me with this? I would be extremely greatfull!</p>
  
  <p>Thanks in advance</p>