I have before insert trigger on account and i want to set primary contact lookup(custom field on account) which match with account name.<br/><br/> **For example, if account name with 'Tony Stark' is inserting then i have to find contact name with 'Tony Stark' and add the lookup in to primary contact.**<br/><br/> For this problem i am using soql query with like filter. List<Contact> lstContact = [SELECT id, Name FROM contact WHERE Name like '%acc.Name%']; **My question is how can i do it for multiple accounts if there is bulk upload?**<br/><br/> Do i have to iterate for each and every account.name and update the lookup?<br/><br/> It will cost more SOQL queries.