My Drupal site draws data from a CRM system that stores info on contacts and companies. In the CRM, the contacts are related to the companies by a common ID. I have set up Drupal to automatically import the contacts and companies as separate content types and keep them up to date. Both the 'contact' and 'company' content types have an ID field, which is used to relate which contacts work for which companies.
I can create a view, with a page that shows an individual company. I am not sure how to attach a view of the contacts that work for the company. I know it would be possible to use node reference and EVA to relate the contacts with the companies manually. Unfortunately when new companies and contacts are added to the CRM the Drupal site needs to be able to create the relationship between the two automatically, probably based on the fact they both share a common value in the ID field.
It would be great to know how other people have managed to create relationships between two content types. I am not sure if there are any modules that can help with this, if I should create a theme template page for the company view page, and hand code some php that queries the database to return the related contacts, or if need to figure out how to build a module to do the above.
Thanks for your help, Paul