Make It More Readable: Enforce Case w/ Simple Workflow Rules

Sometimes the flexibility of Salesforce.com can be intimidating. Whether potential buyers, admins, or users, wrapping your head around all the various tools available to you and imagining how you might used them can be challenging. Sometimes it is the most simple example that starts the wheels turning and leads to a real use case in your business.

I hope this is one of those simple examples. Please let me know otherwise below.

Workflow is a feature of the Enterprise Edition of Salesforce.com that provides a lot of that powerful but daunting flexibility.

I am going to focus on a simple but valuable way to use Workflow to make your data more consistent and readable. I will then show a few screen shots as examples of the setup process and then offer a few additional ways this could help you.

workflow-rule-uppercase-0You and I have a different way of taking notes. You probably write very well. Me, not so much. I use pictures (thanks Tony Buzan!) and you use abbreviations. I oscillate between ALL CAPS and Camel Case (also called Title Caps) and you write in all lowercase.

So, let’s say we are both working together on a deal in Salesforce.com and logging calls, tasks, updating Opportunity and Account information, etc. Our style of writing will start making the information look strange. Certainly my doodles would be absent but my ALL CAPS, Title Caps, and your lowercase notes would certainly stand out.

Many companies require all written forms to be filled out in ALL CAPS due to the variance in how people write letters like o, i, l, and others. It is probably a good idea to set the same rules for information that is typed in since all are used to looking at capitalized letters.

Workflow can do this automatically so no matter who enters valuable information, it will be placed in the right case when it is saved. All we have to do is setup a simple rule with some actions and it will all happen automatically from there.

Inside the Salesforce.com Setup area (click the “Setup” link at the top, just right of center), we will navigate to Setup | Create | Workflows & Approvals | Workflow Rules. Click New Rule and select what object it relates to. In my case, I want Account fields to be saved in ALL CAPS.

After clicking next, choose the criteria of your rule. This is just Salesforce.com asking, “when should I do these actions?” I chose every time the account is saved and when Account Name not equal to null so it will run every time it is saved, whether a new or existing account.

workflow-rule-uppercase-1By clicking Edit on this screen, you can add/modify the actions you want to execute when the rule gets invoked.

workflow-rule-uppercase-2In this case, we just want to take some existing text, such as “Hello world!” and make it “HELLO WORLD!” before saving it. We do this through a Field Update as we are updating the text that exists within a field.

workflow-rule-uppercase-3Here is the simple formula that transforms text into ALL CAPS. You can use this exact syntax for each field as long as you just change the part that is inside the parenthesis to be the specific field you want to change. Use the Insert Field button to pick one and it will insert it into your formula for you.

Once you have done this, simple go back to an existing Account record, edit a field and save it. If done right, all the text fields you assigned actions to will automatically turn to ALL CAPS. The page will be SCREAMING SUCCESS TO YOU!

I’m not angry, I’m excited. Really.

To your success.

signature-transparent

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

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…)