I have an object with a lookup relationship to Account (so it just stores the Id), but I need the account name to be searchable in the lookup dialog for finding
Since you can't search on formula fields, I'm thinking a insert/update trigger on the related object to populate a custom text field on the child object, but can't quite get my head around how to achieve this. Effectively I need to update a field on the object that fired the trigger (which makes me think Before trigger), but pulling data from the parent (which makes me think querying the parent based on it's ID from the lookup).
What's the right way to achieve this while remaining bulkified?
Portfolio Relationship Product Rating +---------------------------+ Account +-------------------+ | ID | +---------+ | ID <------+ Lookup to Product Rating | | ID <---+ Lookup to Account | | | | Name | | Acct Name as text | | | +---------+ | | | | | | | | | | | | +-------------------+ +---------------------------+