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:
- You must use the Application Programming Interface (API) to do it.
- You cannot make any other updates or changes to the record at the same time.
- You must create an
Account/Contactpair. That’s one Account with one Contact. The newPerson Accountwill take the Account name. - The
Accountmust have a blankParent Accountvalue. - The
Contactmust have a blankReports Tovalue. - All data in any shared fields (i.e. phone, etc.) between the
Account/Contactneed 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:
- While logged into http://www.salesforce.com, click the Setup link at the top of the page, just right of center.
- Navigate to
Apps Setup > Customize > Accounts > Buttons and Links. - Near the bottom of the page, click the
Newbutton to the right of the headerCustom Buttons and Links. - Use example image below to match your settings exactly.
- Paste all of the Javascript code below into the code area and save. Preferably the second one for added safety.
- Get the SalesforceID of the Person Account Record Type you would like to convert to.
- Navigate to Apps Setup > Customize > Accounts > Person Accounts > Record Types
- 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″.
- 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
- Navigate to
Apps Setup > Customize > Accounts > Page Layouts - 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.
- Click Custom Links on the left of the Layout Editor Top Bar.
- Drag the Custom Link you created onto the Page Layout and save.
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);
}
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.
Thanks again David and I hope this helps many the way it has helped me.
– Jon






Post a Comment