I have a Drupal View that I'm using to display in a directory a list of individuals that are employed by a group of organizations. I saw no way to filter a View based on employer names so I created a select list whereas I simply added as select options the organizations whose employees I wanted to display.
At first I created this list to be used for 'All Contact Types' and it worked fine. I built a Drupal webform so people could edit there own information and that's when I found that the fields did not autopopulate with the current information. I assumed this was because the fields were user for all contact types and not for only individuals. I built a new custom data set that is used only for individuals and tried that. The Drupal webform would then show current information when the user logged in.
I then realized that I could no longer filter the View with the new fields. When I used the old fields that were allowed for all contacts the filtering worked and I had individuals show in my directory, however, when I switched to the newly created fields that were limited to individuals I has no contact show in my directory.
I've also run a preview within the View itself and only get results when using the custom field built for contacts. When using the one built for individuals I get no results. Any thoughts? The query is:
SELECT DISTINCT civicrm_contact.id AS id, civicrm_contact.contact_type AS civicrm_contact_contact_type, civicrm_contact.display_name AS civicrm_contact_display_name, civicrm_contact.organization_name AS civicrm_contact_organization_name, civicrm_contact.job_title AS civicrm_contact_job_title, civicrm_email.email AS civicrm_email_email, civicrm_phone.phone AS civicrm_phone_phone, civicrm_contact.sort_name AS civicrm_contact_sort_name FROM {civicrm_contact} civicrm_contact LEFT JOIN {civicrm_value_testing_for_directory_25} civicrm_value_testing_for_directory_25 ON civicrm_contact.id = civicrm_value_testing_for_directory_25.entity_id LEFT JOIN {civicrm_email} civicrm_email ON civicrm_contact.id = civicrm_email.contact_id AND (civicrm_email.location_type_id = '2' AND civicrm_email.is_primary = '1') LEFT JOIN {civicrm_phone} civicrm_phone ON civicrm_contact.id = civicrm_phone.contact_id AND (civicrm_phone.location_type_id = '2' AND civicrm_phone.is_primary = '1') WHERE (( (civicrm_value_testing_for_directory_25.nhp_org_191 LIKE '%a%' OR civicrm_value_testing_for_directory_25.nhp_org_191 LIKE '%b%' ) )) ORDER BY civicrm_contact_sort_name ASC LIMIT 20 OFFSET 0