1

I have a custom object that contains a User field, as well as several other fields (Industry, State/Region).

I want to look up these fields based on a Lead record and return the matching user (and then use that matching user for lead assignment)

Pseudocode would be something like

SELECT Custom_Object.User WHERE Custom_Object.State = Lead.State & 
Custom_Object.Industry = Lead.Industry

However, I'm not quite sure what the way to go about this is. I'm assuming I need to link the Custom_Object with the Lead object, but that's as far as I'm able to go. Would I need to invoke an APEX trigger upon Leads being edited?

0

I'm assuming I need to link the Custom_Object with the Lead object, but that's as far as I'm able to go.

You are on the right track here. You though don’t necessarily need to establish a relationship between you Custom Object and Lead as long as you have the right data values from Lead to which form the query criteria to fetch the User from the Custom Object.

Would I need to invoke an APEX trigger upon Leads being edited?

You can use a Process Builder here too if you don’t want to use an Apex trigger. But in general you will need some type of code/config if you want the query to fetch User and assign it as Owner whenever a Lead is created/edited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.