What to Do when Contacts Leave the Company?

Contacts transition companies all the time and when you find out what do you do in Salesforce? The wrong answer is to just delete them.

Before we get too far into the blog post, if you want to skip all of it and just install the App directly then awesome!

Here’s the Unmanaged package:

Contact – No longer at Company V1.0https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1E000000trNv

If you want to learn how to build this yourself, continue on!

There are some ways that would help identify these contacts without deleting them. One of them is to create a checkbox on the contact record that states that the contact is no longer active with that account. You can also place this checkbox just under the contact name so that it would be clear for the end-users. Another idea is to add a Status picklist field that has “Active” and “Inactive” options and that should always default to “Active” unless someone chooses the other choice. You’d use this option if you have more than two options to track. For example, “On Leave” could be something you need to track but most companies aren’t getting that granular with their relationships and therefore a simple checkbox is used in our example. 

Either the checkbox field or the picklist field can be the criteria to trigger an automation tool to stop any usual activity that happens with the active contacts. You can also set the automation tool to update the last name of the Contact and add to it  “ – No Longer in the Company” text at the end. Moreover, if you usually send emails to the Contacts you can set the automation tool to check the “Email Opt out” field to be sure that the inactive contacts will not receive those emails anymore. The same with any open tasks for the record of that contact, the automation tool can simply end the task. Another method is to add a quick action on the contact object to update the checkbox you created previously. 

With any of these ideas , you will be able to report on the Inactive Contacts without the need to delete them. That way you will have clean data and clear history.

 

Here is how to build Process Builder and Quick Action included in the Package above :

A Process Builder that updates the “Email Opt out” field and the contact’s last name.

  1. Create a “No Longer at company” Custom field or Picklist depending on your requirements
  2. Create a new Process Builder with
  3. Set it to Trigger on the Contact object
  4. Enter your entry criteria according to your requirements (i.e. No Longer at Company = True)
    2019-07-17_0626.png
  5. Add the first immediate action to update on the Contact object with updating with no entry criteria and updating the Email Opt Out field to True
    2019-07-17_0629.png
  6. Add the second immediate action to update the Contact object with the Last Name field with appended text formula.

    Formula:

    SUBSTITUTE(
    [Contact].LastName ,
    [Contact].LastName ,
    [Contact].LastName +
    ” – No Longer at the Company”
    )

    2019-07-17_0630.png

  7.  Activate your new Process Builder and move on to adding the quick action.

 

Quick Action that checks the “No Longer at the Company” field

  1. Go to Setup > Object Manager > Contact > Buttons, Links, and Actions
  2. Create a new Action called No Longer At Company to Update a Record as the Action Type.
    2019-07-17_0638.png
  3. Click New under the Predefined Values section and add a formula value of True to the No Longer at Company field.
    2019-07-17_0640.png
  4. Click the Edit Layout button and make sure that the No Longer at Company field is on the layout and any other fields you want to add to this quick action layout.
  5. Add this Quick Action to relevant page layouts and you’re all set!

 

Using Bucket Fields to Force the Sort Order of Bar Chart Graphs

Salesforce is great sometimes at deciding for me what it thinks I want. In reports, you get some basic sorting options – Ascending and Descending which is good if your data conforms to that model. Most of the time it will because it’s a date, monetary value, etc. However, that’s not always the case and you can use the bucket field to hack your way into seeing the values the way you want to see them.

What if we want to force the sort order of data on a report or dashboard so the data shows in the stacked order you want.

Here’s an example, suppose you have a custom picklist field on the opportunity object called “Deal Type” with Values – New, Existing Business, Renewal , Referral. 

Create a report on the Opportunities and choose the grouping by the “Deal Type” field. 

You will also have the option to sort the report ascending or descending from the perspective of that field. 

SQ6-2.jpg

Then run the report after you choose the sorting required. This will give you a summary of the opportunities based on the Deal Type field and sorted ascending or descending as you choose.

SQ6-3.jpg

You can also choose to add a chart! This will visualize your data even better. Just add a chart from the edit preview and choose the chart type you like. This example is showing the bar chart.

SQ6-4.jpg

Run the report after adding the chart and choosing the sorting order and you will see how beautiful your data is visualized.

SQ6-5.jpg

Now, what if you want to force the order of the values of the “Data Type” field to be with specific order neither ascending nor descending. For example, you want the values to be in this order: Renewal, New, Existing Business , Referral. From the edit preview , beside the “Deal Type” field there is an option called “Bucket This Column”.

SQ6-6.jpg

Create the Bucket field values with the same exact values as the picklist but in the new order required. Then match the bucket values with the respective bucket.

SQ6-7

It should look like this:

SQ6-8.jpg

Choose the grouping to be by the newly created bucket field and you will find them in the new order.

SQ6-9.jpg

Add the chart again and run the report.

SQ6-10.jpg

You will find the chart and the report sorted nicely as required. The “Bucket” feature is a powerful tool that can be used in different ways. 

 

4 Salesforce Page Layout Design Principles I’ve Used for Years

I’m taking this blog in a different direction and am going to be generating a combination of Post and Video when appropriate. The intent is to have the video content reinforce the blog details. So, with that said, welcome to my first video/blog combo!

Over a decade or so of Salesforcing I’ve setup a few custom objects in my time. I’ve found that a well designed page layout makes adoption much easier for the end user and makes the data flow better when being consumed both in edit and read mode. They are super easy to implement so let’s get into it!

 

Move like fields together

When you think about the design of your object and how users are going to be interacting with it you should group like fields together. In our example, the Audit fields for Account/Contact lookup can group together because they are both lookup type fields but also because they may be updated in a subsequent save. In addition, the Status and Date fields can be grouped together because the business use case necessitates that both details would be known and/or change at the same time.

Require fields at the Page Layout Level

The distinction here on whether to require a field at the page layout level or at the field level is based on use case. If the end user will always, no matter what, be required to have the data then you can put the requirement at the field level which is the most restrictive. However, in our use case here the customer will not have perfect data when they import and will update the details as more information comes available. Therefore, we want to allow them to import and edit afterwards.

Large Text Areas get their own section

This principle is fairly straight forward, large text areas in two columns are ugly and in one column is pretty.

Hide or Move to the bottom all system fields

System fields often need to be referenced visually by the user on occasion so its good to include them on the page layout. One trick I use is to teach users how to collapse sections which makes navigation much easier. Its one of the Ah-Ha moment for users.

The Best Salesforce Swag I’ve Ever Received

Check it out! I bet you don’t have one of these. Let alone two.

Image

A while back I had the great pleasure to run into a former colleague and boss of mine from my time at Salesforce Support. We got to talking about our favorite swag and I mentioned my Tie-Dye T-shirt. Long story short, there happen to be a box of them sitting just across from his desk. He sent me one and now I have two. You can tell, I really got some use out of my old one.

Despite being awesome, the Tie-Dye doesn’t make this my favorite piece of swag. Cread Hietakangas was a former colleague of mine at Salesforce Support who passed away several years ago. He was, simply put, an actual Salesforce Rock-star. No joke, the best.

I never told him this but I respected him and kinda hated him for how good he was at his job. Call it my youthful ignorance but its tough always playing second fiddle. Always being on the JV team. Sadly, I also never told him that he pushed me to make myself better every day. Being excellent at his job propelled me, in a some-what juvenile competitive way, to be better at mine. I wish I had told him that. The funny thing is, he still pushes me to be better.

It’s interesting how different people make profound impacts on your life. It might be odd to draw inspiration from a piece of Salesforce Swag, let alone a Salesforce T-shirt, but I do. Not because its Tie-Dye, which is awesome, as I’ve mentioned, but because ever time I see it I remember someone that was truly dedicated to being excellent at everything he did. That reminds me, in some little way, to strive to be excellent as well.

For what’s its worth now. Thank you Cread.

I guess what this post is really saying is, find your Excellence Muse. For me, its a Salesforce Tie-Dye T-shirt. What’s yours?

Hiring your next Salesforce Rockstar – Part 2 of 3

In part 1 I discussed how to define out your specific needs and to look for “My Rockstar” instead of just “A Rockstar”. This point is important to consider in our second part. The term Junior or Associate gets a bad wrap these days. I’ll admit, I’m a little bias myself when I see it. We think it means “No Experience”, “Average Performance”, “Not worth my time”, etc. This may not always be the case but I think everyone has run into this “junior” wall before.

If you’re reading this post you’re likely looking at hiring your first Salesforce Professional and that can be scary if you’ve never done it before or not sure what to look for. I’ll send you down two paths:

IF this is your first Salesforce hire then my suggestion is to hire someone with a bit of experience under their belt. Even a few years of working experience in the Salesforce ecosystem gives people a skill set that can’t be replicated in school or in other roles. For example, Admins with experience often know how to determine the right way to do something as opposed to the way you know how to do it. On the other end, you are likely to be inexperienced in working with an Admin and thus the relationship may not blossom as much as you hope.

There are some other options if you have never hired a Salesforce Admin before that will help you determine what you need and help define the skill sets you are likely to need in a resource.

Contracting:

There are several options to hire short and long term contractors on full-time, part-time, or even by project or ad-hoc basis. For example, Upwork.com has a large collection of Salesforce experts at a wide range of price ranges and expert levels.

Salesforce Partners and Consulting shops are also a good way to hire an Admin-As-A-Service type role.

Finally, link up with your local area’s User Group and ask for help. The User Group leader for your area usually has their finger on the pulse of who’s available and you get the bonus of getting a local person. Likewise, area businesses are almost always willing to share contacts of people they have worked with in the past.

 

IF you have hired some Salesforce professionals before and are familiar with your requirements for the position I implore you to think creatively and go “Junior”. As I mentioned before, this doesn’t have to be someone that is in-fact Junior but might be someone that doesn’t have a strict Salesforce background but has complimentary skill sets that enhance their value.

I’ll give you an example. I recently hired a Full-Stack Engineer out of a coding boot camp who was a career shifter from the banking industry. Their background is in ReactJS and they did several projects with this language in the coding boot camp they graduated from. I recently had a project handed to me to investigate Twilio Flex and the integration into Salesforce that integrates a softphone into Salesforce Service Cloud. Surprise, the front end of the softphone can be customized using… you guessed it, ReactJS.

You can learn Salesforce if you have a strong technical background. Salesforce Trailhead makes that easy. But its a little more difficult to go the other way and take a pure Salesforce Admin and teach them complimentary skill sets you might need. Exploring options in hiring “Junior” help to tackle this sort of need and gives you the freedom to train and mold a candidate.

Clean Up Poorly Formatted Data with RIGHT and LEFT Formula Functions

Poorly formatted data is a pain to deal with. In most cases, there isn’t much you can do about it. However, in some areas, such as URL’s, there is and we will explore an example of how to do this leveraging Salesforce’s RIGHT and LEFT formula functions.

sq2-1

Full credit for the inspiration for this post goes out to Sunil Sarilla, Salesforce MVP and Answers Community Champion.

Inspiration Post: https://success.salesforce.com/answers?feedtype=RECENT&criteria=BESTANSWERS#!/feedtype=SINGLE_QUESTION_DETAIL&dc=All&criteria=BESTANSWERS&id=9063A000000pVAsQAM

Poorly formatted data causes errors, lost time, and frustration among your users. However, validation rules aren’t always the best bet to force good data as you sometimes want to capture the data as it comes in such as in a web-to-lead form or via mass upload. Another good option is to have Process Builder or Workflow manage the data cleanup for you.

Take a look at an example of poor data; the Website field on the Account object is of DataType URL. But if this field has a strange character at the end … This doesn’t look like the quality of data we would like to have!

sq2-2

The Standard Website fields don’t have the same custom URL field validations on them and are essentially just text fields for all intents and purposes. This means that it accepts poorly or even incorrectly formatted URL’s. No matter how Awesome you are, bad data will always creep up on you and here’s one area where you can do something about it.

Suggested Solution:

Let’s design a Workflow Rule that detects similar data on that field and adjust it.

Here is a walkthrough:

1- Create a Workflow Rule on the account object and choose the Evaluation Criteria to be “created, and any time it’s created to subsequently meet criteria”.

SQ2-3.jpg

2- Set the Rule Criteria as “formula evaluates to true”. Then add the following formula :

RIGHT(Website,1)=’/’

SQ2-4.jpg

3- After saving, choose the Immediate Workflow Actions to be “New Field Update”

sq2-5

4- Add the Field Update, Choose the ‘Website’ field as the field to update and then add the formula that will correct the Data :

LEFT(
   Website, LEN(Website)-1
)

sq2-6

Finally, Save and activate the Workflow Rule. This will definitely prevent similar future errors. As you notice other invalid data to clean up you can add them to the criteria in the workflow rule. Likewise, you can use the RIGHT function to capture cleanup details on the right side of the URL. 

Denote Duplicate Records when Users Create them Manually

In this blog post, we explore the options to identify the duplicate record created when users are presented with the duplicate management warning message.

Full credit goes out to Tom Hoffman (https://success.salesforce.com/ProfileView?u=0053000000BgRsl) over at Accidental Admins (https://twitter.com/AccidentalAdmin) for the solution. I originally was sparked to write this post off of a Post I saw on the answers community – https://success.salesforce.com/answers?feedtype=RECENT&criteria=BESTANSWERS#!/feedtype=SINGLE_QUESTION_DETAIL&dc=All&criteria=BESTANSWERS&id=9063A000000E0OyQAK

I thought it was a neat solution so I wanted to explain it out step-by-step.

untitled

Business Requirement:

We definitely need to identify duplicate records created by users when they ignore the duplicate rule warning. Administrators need to know which is the duplicate record to merge them later as well as hone the duplicate management rules to improve duplicate rule performance.

Is there a way to stamp these records as DUPLICATE without apex?

untitled2

Suggested Solution:

Designing a Process Builder that updates a number field on the duplicated record once created as an indicator. Here is a walkthrough :

 

1 – Create the number field on the object, set the default value to 0.

untitled3

2 – Create a Process Builder on the DuplicateRecordItem object and evaluate when the record is created only.

4

3 – Set the Criteria; Choose the Condition field to be the Record ID from DuplicateRecordItem Object.

5

4 – Then, set the condition so that the Record ID starts with 003 (for contacts); check this link for ID prefix for each object.

6.png

5 – Add a field update for the field created in the first step; Let the value of the field be updated to “1”. Power of One – this will be helpful when you run a report especially if you want to know the number of duplicates in specific Accounts.

7

8

 

And… Now that you have read through this post completely here’s a small package you can install in your org if you don’t want to build the Process Builder and the Custom Field yourself. We have set this example up under Contacts as this is likely going to be the most common duplicate object we run into but the setup is the same for all objects.

Contact Duplication Identification: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1E000001AX9L&isdtp=p1