function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric Boller 14Eric Boller 14 

How to populate/create lookup relationship with the ID

Hello,

How can you create a lookup relationship using the ID for the related record? For example, we have a lookup relationship from leads to contacts. There is a field on the leads containing the ID of the contact that the lead should be joined to. How can we automatically create this association?
Andy BoettcherAndy Boettcher
If you have a lookup relationship defined on the Leads object to the Contact object, all you need to do is place the ContactId in that field and insert/update the record.  That's it!
Eric Boller 14Eric Boller 14
How do I do that though? Doesn't look like a workflow can copy the value there?
Andy BoettcherAndy Boettcher
Workflow cannot, but Process Builder can!
Eric Boller 14Eric Boller 14
Good idea. It looks like I'm only able to populate a lookup field with another lookup field. I want to populate a lookup field on the Lead with a text field from the lead. Am I doing something wrong?
Andy BoettcherAndy Boettcher
Hmmm - good point.  Sometimes I love getting surprised by things.  You may be looking at a trigger here if that feature isn't delivered with Summer '15 next weekend.  =(
Eric Boller 14Eric Boller 14
Darn, thanks for trying anyways. Obviously I'd prefer to stay away from a trigger for something so simple if possible. Any other ideas on how to accomplish this?
Andy BoettcherAndy Boettcher
Ya know, have you played with Flow?  Flow gives you a LOT of flexibility this way - and if you make it trigger-ready you can call it from Process Builder (no code!)