Thursday, March 28, 2013

Salesforce.com - Lookup filter based on text field

Need to filter a lookup field based on a text field? This is currently not supported by SFDC. 
But, there's a workaround for that:


  1. Create a new picklist field
    1. the values are not important, they won't be used
    2. don't show it on the page layout, as it's not interesting to the user.
  2. Create a trigger to copy the value from the text-field (which you want to use for filtering) to the new picklist field
  3. Filter the lookup based on the picklist (this is supported)