Understanding Business Accounts and Person Accounts – Part 2

In Part 1 of this series, we reviewed the difference between a [Business] Account and a Person Account.

Moving from a Business Account to a Person Account is very common and the converse can be as well so how do we make this easy to do?

Let’s review the requirements to create a Person Account from a Contact.

Salesforce states the only path to change a Contact into a Person Account has these requirements:

  1. You must use the Application Programming Interface (API) to do it.
  2. You cannot make any other updates or changes to the record at the same time.
  3. You must create an Account/Contact pair. That’s one Account with one Contact. The new Person Account will take the Account name.
  4. The Account must have a blank Parent Account value.
  5. The Contact must have a blank Reports To value.
  6. All data in any shared fields (i.e. phone, etc.) between the Account/Contact need to match.*

* I have found that converting a Contact with a mailing address and an Account with no address still works with the address being added to the new Person Account.

As I was looking to solve a different problem today, I came across a solution that made this process simple. Instead of using the heavy apps mentioned in my previous post, this one involves adding a simple Custom Link on qualified Business Account Page Layouts that will convert the Account/Contact into a Person Account.

To get this done, follow or print this page for your Salesforce Admin:

  1. While logged into http://www.salesforce.com, click the Setup link at the top of the page, just right of center.
  2. Navigate to Apps Setup > Customize > Accounts > Buttons and Links.
    Navigate to Account Buttons and Links

    Navigate to Account Buttons and Links

  3. Near the bottom of the page, click the New button to the right of the header Custom Buttons and Links.
  4. Use example image below to match your settings exactly.

    Create the Custom Link using Javascript

    Create the Custom Link using Javascript

  5. Paste all of the Javascript code below into the code area and save. Preferably the second one for added safety.
  6. Get the SalesforceID of the Person Account Record Type you would like to convert to.
    1. Navigate to Apps Setup > Customize > Accounts > Person Accounts > Record Types
    2. Copy the value after the “id=” in the URL either by clicking the Record Type name or copying the URL to your clipboard. It usually starts with “012″.
    3. The value I used out of my url is bolded here:
      https://na2.salesforce.com/setup/ui/recordtypefields.jsp?id=0124000000011NS&type=01I400000005qaX&setupid=PersonAccountRecords
  7. Navigate to Apps Setup > Customize > Accounts > Page Layouts
  8. Click the Page Layout you would like to add this Custom Link to. Security note: If you add this to a widely visible Page Layout, you may find that people will convert B2B records because they can. Sigh.
  9. Click Custom Links on the left of the Layout Editor Top Bar.

    Drag your Custom Link onto your Page Layout

    Drag your Custom Link onto your Page Layout

  10. Drag the Custom Link you created onto the Page Layout and save.

    Custom Link is in the Custom Links section in the Page Layout Editor

    Custom Link is in the Custom Links section in the Page Layout Editor

Here is the code courtesy of David Schach of X2OD.com:

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var AccountObj = new sforce.SObject("Account");
AccountObj.Id = '{!Account.Id}';
AccountObj.RecordTypeId = '0120000000000000'; // Change by pasting new RecordTypeID
sforce.connection.update([AccountObj]);
location.reload(true);

Changing the red/bold RecordTypeID will change the behavior from a Business Account => Person Account to a Person Account => Business Account. I suppose you could also use this same method to switch Accounts to other Record Types withing B2B and B2C such as a Vendor to a Partner Account, etc.

I like a little confirmation and feedback just to make sure I don’t accidently do this and cause trouble for me (or my client!) so I added a confirm() and alert():

// convert TO a Person Account
{!REQUIRESCRIPT(”/soap/ajax/13.0/connection.js”)}
if(confirm(’Are you sure you want to convert this Account and Contact to a single Person Account (B2C)? This is NOT reversable.’))
{

var AccountObj = new sforce.SObject(”Account”);
AccountObj.Id = ‘{!Account.Id}’;
AccountObj.RecordTypeId = ‘0120000000000000‘; // Paste B2C RecordTypeID
msg = sforce.connection.update([AccountObj]);
alert(msg);
location.reload(true);
}

Custom Link is now visible on specific Page Layout

Custom Link is now visible on specific Page Layout

This will show a little popup confirming what you are doing and that it is not reversable. It is reversable with a little work but I would like others to realize that they should only do this if they know what they are doing. This avoids the accidental curiosity clicks. This also saves the response from Salesforce for a simple alert to confirm all was successful or the error if received. The original behavior just reloads the page with no messaging.

Person Account Created. Success!

Person Account Created. Success!

Thanks again David and I hope this helps many the way it has helped me.

– Jon

Avoiding Number Formatting Problems in Salesforce.com Fields

An issue came up with a client recently that will help other Salesforce.com users I’m sure. The issue relates to the increasing use of unique and long numbers in business. From account numbers, merchant numbers, to Tax ID numbers, we have lots of numbers to keep tabs on.

Salesforce.com is a great place to keep these numbers. However, if you create a custom field and store them as numbers you will find your formatting probably will not be allowed or preserved.

A couple examples:

  • US Tax ID numbers are in the form of: 88-8888888. This number contains a dash after the first 2 digits. Social Security Numbers have the same problem with two dashes: 888-88-8888. Not allowed as a number with the dashes so you are forced to enter in the numbers by themselves, removing the intended formatting and giving you a new format: 888,888,888.
  • An account number with a vendor is 8847506644758 and can be saved as long as it is 18 or less digits before the decimal. However, when you view it, it shows 8,847,506,644,758 which is a little distracting to the eyes and confuses the fact that this number is an account number, not a numeric total of something else.

The solution in both of these cases is to only store numeric data that will be related to calculations in formulas, reports, etc. There will never be an example of subtracting two SSNs or adding merchant numbers together so storing them as numbers, even though they are, is unnecessary and cumbersome.

The rule should be:

  1. Only store numeric data as a number when it quantifies something.
  2. Otherwise, use text and include any spaces, dashes, or other characters that make it more easy to read and parse (i.e. 66898-9865-57377)

– Jon

Understanding Business Accounts and Person Accounts – Part 1

How you store your client information inside Salesforce.com makes a big difference. One area where this is very clear is Accounts and Contacts. Salesforce began as a business tool and therefore focused on business to business (B2B) relationships. Therefore, the Account object is oriented toward a business or company by default.

These relationships look like this:

ACCOUNT (i.e. Acme, Inc., www.acme.com, 1-800-ACME-INC)
|
|
----- CONTACT (i.e. Joe Smith, joe@acme.com, 555-555-1212)
----- CONTACT
...

This works great when there is a company such as a company client, vendor, or partner and it has employees that are related to it.

However, what happens when the client is an individual person such as someone who bought one of your e-books or a t-shirt? What happens when you are a nonprofit that relates to individual as well as institutional donors? (more…)