From Zen Cart to Salesforce – Handling Accounts

Unlike most B2C e-commerce systems, Salesforce makes a distinction between Contacts, which are identified by an email address, and Accounts, which are identified by a name and site.  Contacts belong to an Account, and an Account may have many Contacts.

The way I handled this relationship in the first version of  Zen Cart to Salesforce was simply use the email address as the Account name. This has a significant advantage, since the email address for a shopping cart account is an immutable field.

However, some larger customers have multiple email addresses associated with a single account.   Also, some customers had e-mail address changes over the life of their relationship with me.

For these reasons, I decided to add a “salesforce_account_name”  field to the customers table.  I populate this only in cases where the email address is not sufficient.   I also had to modify the customer export script to export that field rather than the email address in the Account column of the CSV when it was set.

This new way of handling Accounts is reflected in the 360 Sales Reporting modification I did, to get more accurate per-account sales data.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.