Reference Based on Two Fields of a Content Type I have two content types account and device. device has a reference field named reference_account_number and it's referencing account_number in account, but the unique key for account is a composite key account_number and environment. 

I used auto node title module to generate the node title based on account_number for account, and let reference_account_number map on to the node title of the account nodes.
So my problem comes up when I try to do feed import when there are duplicate account_number but different environment. The reference_account_number only map onto the account node that has matching node title.

Is there any way to reference another node based on two fields?
I was thinking about adding a environment field to device content type as well

Ideally, I would like this scenario happens when a user creates a new device content.

User enters the account number and environment, upon completion, user views the content just created, and reference account number provides a link to all existing account that matches the account number user inputted for the device content, same thing goes for environment

Thanks
Is there any reason why you could not just reconfigure auto node title to generate a node title based on a composit account number and environment -- say, something like "[account_number] ([environment])"?  It seems like if you did this, then your reference_account_number configuration would remain unchanged, your feeds will not get confused, and users can still add references by typing the account number only thanks to the standard autocomplete feature of node references.

If you did not like the way that "[account_number] ([environment])" looks in the output of your site, you could alter the render array, maybe in a hook_process_field.  For a good description on hooking the Drupal 7 render process, see The Scary Render Array.