Prior to inserting records into Salesforce Magento MUST make an attempt to locate a record. Customer lookup has several phases:
- Attempt to locate a Magento customer in Salesforce Lead collection
- Attempt to locate a Magento customer in Salesforce Contact collection
- Attempt to locate a Magento customer in Salesforce PersonAccount collection***
- Attempt to locate a Salesforce Account based on a company name stored in Billing or Shipping Address in Magento
General Assumptions
Magento allows merchants to configure customer account sharing options to either use "Global" or "Per Website".
If set to "Global" - lookup only uses customer email address in attempt to find a matching record in Salesforce.
If set to "Per Website" - in addition to the email address, "Magento Website" is also used in attempt to uniquely identify a record in Salesforce.
Lead Lookup
Lead object in Salesforce represents a potential buyer.
Required fields:
- LastName
- Company
If PersonAccounts are enabled in Salesforce org, Company field becomes optional
If person account record types have been enabled, and if the value of Company field is null, the lead converts to a person account.