Steps to Configure Lookup Query
        
         
         
          - Create a query. Select the Visible in API check box.
 
          - Select the Lookup Set form and open the object for which you have created the query. The example in this case is PROJECT.
 
          - In the Lookup tab, add the Lookup Code and provide the custom query in the Query Code column.
           
 
          - In the Lookup Language tab, add lookup code and all columns labels which were mentioned in custom query for the required language.
           
 
          - In the Lookup Set tab, add the lookup code.