Salesforce Formula Fields & Picklist Fields/Values

Salesforce Formula Fields & Picklist Fields/Values

It’s always “refreshing” to find something so innocuous in Salesforce that kind of throws you for a loop.  Especially when this “innocuous” item is a little counter-intuitive to the Salesforce mantra of “clicks not code”.  Plus, it appears to have impacted people for quite a while.  Warning:  This post may be (i.e., is) a little pic heavy.

Salesforce!?!

Anyways, I’ve been working with a client on their Salesforce roll-out for a few months.  It’s not a big roll-out but one that’s big enough to necessitate some custom integration.  Within their org they have a picklist field on Leads, Account, and Opportunities to easily identify and report by corporate division for ownership purposes.  The Label Value of the picklist values is a text string with a company number identifier and name concatenated together, e.g. ‘## TEXT OF NAME’.  The integration team only wants to use the company number value (‘##’) for incoming and outgoing communication with external systems.

So, to accommodate this we updated the API Values for the picklist values to just be the numerical values at the start of the Label Value (e.g., Label Value ’01 US Division’ and API Value ’01’).

However, this is where a loop is thrown…

This company identifier picklist is an Account field but when we attempt to reference that value on, say, an Opportunity via a formula field (e.g., TEXT(Account.Company_Number__c).  Unfortunately, the value returned is NOT the Label Value but is the API Value.  That is, I expected to get back ’01 US Division’ but only received ’01’.

I can kind-of, sort-of understand why this would be the case.  The API Value is used in Apex and all the front-end configuration is essentially creating Apex without really coding.  BUT, from a practical standpoint it doesn’t make sense since I’m referencing a field from the front-end in a formula field and expecting that same front-end display value back but, instead, am given the back-end API Value.  Boo, Salesforce.  Boo!

Potential Quasi-solutions…

There are a few options:

1) Custom Apex – No thanks, Salesforce.  “Clicks, not code”, right?!?

2) Update Formula Field with IF Statement and Hard-Code of UI Values – I opted to go this route.  I very much dislike it since we’re hard-coding a map of values from the returned picklist API Values to recreated Label Values.  In some cases this could be problematic as picklist values have the potential to change causing issues with the formula field.  Thankfully, this customer’s values have been very stable and unlikely to change.  Still less than ideal in this case and, potentially, a pain in the butt for other clients.

Here’s the updated formula for the field with hard-coded values (YUCK!):

 

And, here’s the final result on the Opportunity:

In the Success Community We Trust…

The one thing I do love about the Salesforce community is that nearly all issues you run across have been found and reported to Salesforce previously (sometimes years ago).  And, this issue is no different.  This specific Idea is “under review”.  So, there’s still hope!

If you’d like to see how CleanSlate can help you take full advantage of your Salesforce org please shoot us an email!

Giving Back is Part of What We Do

Giving Back is Part of What We Do

One of our practice goals for 2018 for the Salesforce team was to donate/volunteer our time to the communities in which we live.  We are attempting to follow Salesforce’s 1-1-1 initiative as much as possible.  The size of our company and team doesn’t give us much ability to hit the 1% of our time goal but we are attempting to get as close as possible with quarterly volunteering opportunities.  Our team partnered with Second Helpings (a local non-profit).

What is Second Helpings?

Second Helpings mission is “Transforming lives through the power of food”.  They have two sides to their organization – 1) Chef training for the unemployed and underemployed and 2) Meal preparation for many other local non-profits.  Second HelpingsSecond Helpings take in food from various local donation sources including grocery stores and restaurants.  The chefs-in-training then prepare menus based on the availability and in some cases unavailability of certain items.  Also, the chefs receive education in other life skills such as mortgages, checking accounts, and credit.  So, they leave with a well-rounded set of both work and life skills.  As an example of the “unavailability” our volunteer liaison told us about the time that they made pasta sauce with Bloody Mary mix when no tomato sauce was available.  So, to say that they are a resource bunch is an understatement.

Additionally, the depth and breadth of their ability to track throughput of donations in and meals out is a testament to ingenuity and logistical prowess.  The amount of food that is considered “waste” (which is composted) was less than 10% of their intake.  That’s an awesome percentage given the amount of food that they receive and then distribute as meals or re-donate to local food banks.

So, what did the CleanSlate team do?

Well, initially, they let us sample their food!  The chefs-in-training take great pride in their work and you can definitely see and taste it.  Typically, the chefs prepare food in buffet style.  However, when we visited they had prepared a huge menu of options including appetizers, salads, and sandwiches.  Our team ordered a few appetizers (fried green beans, onion rings, and cheese sticks) as well as a few entrées including barbecue chicken sandwiches, hamburgers, and salads.  The food was very good!  They included dessert options but our team was ready to get to work.Trimming Those B-Sprouts

The regular volunteer staff gave us an introductory tour and instructions on when to wash hands and to re-glove our hands.  We then set off on peeling and cutting onions as well as peeling and cutting brussel sprouts.  This may not sound glamorous as a volunteering activity but it was actually pretty fun when you have 6 other friends with you.  The onions did make most of us cry a time or two…but I digress.  The chefs made us cookies as a “thank you” (I’d like one of those right now, actually).  And, at the end of our shift we swept, mopped, cleaned our knives, and prepared the kitchen for the next day.

All-in-all, the team had a good day and we hope that we were able to provide some value to their chefs’ cooking.  I think we’re going to like working with Second Helpings and are hoping that we can also donate some time to help them with their Salesforce org.

If you would like to see our other company-wide volunteer activities you can check-out this link.

Why Maintaining A List of Supported Browsers and Versions Is Important

Why Maintaining A List of Supported Browsers and Versions Is Important

All browsers are not born equal.

While most people have preferences for one browser over another based upon look-and-feel or specific pieces of functionality.  Those same people probably feel that all browsers are inherently the same on a foundational level.  Unfortunately, that’s just not the case: Internet Explorer is different than Edge who is different than Chrome, Firefox, Safari, etc. They are built upon different underlying code. For example, Safari uses Webkit, Chrome uses Blink, Firefox uses Gecko, IE uses Trident, and Edge uses EdgeHTML.

These foundational differences in how each browser was developed means that the experience that each user has when visiting the Innovation Portal will be situationally based upon the browser they use. The site may look beautiful in Chrome and Safari while it looks terrible in Edge. This situation is exacerbated when you start to include different versions of each browser.

Versions Matter, Too!

The individual versions of each browser that particulars use to access your site can present a WIDE variety of user experiences. To see this for yourself load a new Internet Explorer browser, hit F12, and select the “Emulation” tab. Under the “Mode” section you can change the “User agent string” to various versions of Internet Explorer. Select an old version (e.g., IE 6, IE 7, etc.) and navigate to your favorite web page. Many, such as CNN, will include a warning that your browser is out-of-date and the entire user experience will most likely be different than what you are used to seeing.

So what? The importance of maintaining supported browsers and versions is multi-purposed. On the one-hand, it allows you to focus your development process time and effort to providing your users a meaningful experience within the context of how they interact with your site. If a majority (or even plurality) of your users hit your site with a single browser and are all within the last couple major releases of that browser then you can direct your development processes to ensure that you meet your users with the experience that they have come to expect for the Innovation Portal. Conversely, you do not want to spend time and effort chasing a browser or version that is only used by a tiny fraction of your entire user base. Your development dollars are better spent providing most of your users with an increased experience.

Secondly, browsers are constantly being updated to ensure that they are safe and secure while providing enhancements that improve usability. By keeping your site’s code fresh and in line with these newer releases your site can take advantage of these improvements. This reduces the amount of “technical debt” that you could incur by letting your browser supportability lapse several major releases which could hamper user adoption.

I was told there would be no math…

As a matter of “comparison shopping”, the current global market share of browsers are:

– Chrome 52.5%
– Safari 28.36%
– Firefox 5.26%
– Internet Explorer 5.1%
– Edge 3.39%
– Samsung Internet 1.84%

Similarly, the current North American market share of browser versions are:

– Chrome 63.0 27.73%
– Safari iPhone 17.76%
– Chrome for Android 17.48%
– Safari iPad 5.17%
– Internet Explorer 11.0 4.47%
– Firefox 57.0 3.31%

Click here to learn more about CleanSlate and how we can keep you out of “technical debt” and on top of your web game!

Add a Custom Trailmix to Trailhead

We’ve previously introduced you to Salesforce’s Trailhead.  However…

if you haven’t read that post yet OR if you want a TL;DR then, Trailhead is a free training platform offered by Salesforce.  With Trailhead anyone is given the ability to learn, use, and extend the Salesforce platform through development environments of Salesforce Sales and Service Clouds.  The various training paths are separated into “Business User”, “Admin”, and “Developer” paths and are then subdivided by level (e.g., Beginner, Intermediate, and Advanced).  The Trailhead team has also “gamified” platform in that users earn points and badges based upon the number of trails, modules, projects, and superbadges that they complete.  (Humble brag time) My current badge count is 182 accounting for 119,475 points. Trailhead

Last Fall, Salesforce rolled-out the ability to define custom Trailhead learning paths called “Trailmixes”.  With these “Trailmixes”, you can create specific and targeted training paths for your users.  You want your users to learn a combination of Sales Cloud basics, Lightning Experience Basics, and Privacy/Data Protection concepts?  Easy!  Simply create a Trailmix that includes the “Salesforce User Basics” module, the “Learn to Work in Lightning Experience” trail, and the “Learn Privacy and Data Protection Law” trail.  Then, all your users would need to do is to log in to Trailhead and start the Trailmix.  This is a great way to prioritize the Salesforce learning that your users undertake.  As an example, here’s a Trailmix I created for new business users of Salesforce at CleanSlate.

Trailhead remains the best Salesforce training resource available.  And, it’s absolutely free!

Creating a Salesforce Process and Flow to Associate Account and Contacts During Lead Conversion

Creating a Salesforce Process and Flow to Associate Account and Contacts During Lead Conversion

Salesforce’s standard Lead Conversion leaves a lot to be desired, unfortunately.

For example, the standard conversion process does not create an association between a Contact and an Account unless you are:
1. Creating a new Account and new Contact;
2. Creating a new Contact to associate to an existing Account; or,
3. Creating a new Lead using an existing Account and an existing Contact associated to that Account.

Thankfully, they have provided the means to enhance the functionality without touching a single line of Apex. As a note, this presumes that your org is configured to allow Contacts to be associated with multiple Accounts AND that you’re expecting an Account, Contact, and Opportunity as an output of the conversion process. So, the scenario below works IF you are creating a new Account and associating it with an existing Contact (who has a primary relationship with a different Account).

Process Builder

This can be achieved by creating a Process in Process Builder for the Lead object that checks that:
– “IsConverted” flag is checked; and,
– “ConvertedOpportunityId”, “ConvertedAccountId”, and “ConvertedContactId” are not NULL.
Process Builder

Flow

This combination of fields validates that the Lead has been corrected converted and has the appropriate association with the downstream objects/records. The flow then takes the record ID of the Lead as its initial input (we created a custom field to store this value just as an internal validation). From that Lead record it returns the IDs in the “ConvertedAccountId” and “ConvertedContactId” fields. These ID values are then used to query the Account Contact Relationship object to determine if a relationship currently exists. If the answer is “No” then we create that relationship (which appears as the secondary relationship for the existing Contact). If the answer is “Yes” then we proceed to the next step.  This step makes updates to the Opportunity record (e.g., changing a field value and updating the Oppty name per a specified naming convention).

Flow

Not without an issue…

There is, however, a final scenario in which Salesforce presents a glaring bug, limitation, issue (whatever you want to call it – but it’s been submitted to Salesforce as a bug) that this Process and Flow does not cover. This scenario is when you want to convert a Lead that points to an existing Account and an existing Contact who does not have an existing relationship with the specified Account. For example,
– Contact 1 has a relationship with Account 1
– You create a Lead with Account 2 and Contact 1

During the conversion process Salesforce ignores the Account specified and substitutes in the Account that’s associated with the Contact. Bug logs, unfortunately, provide no clues as to the cause. Workarounds do exist but…they require additional fields on the Lead which, in turn, rely on user input and would require an update to the Flow to take this additional data into consideration. Hopefully (fingers crossed), Salesforce responds to my case with an update in the near future!! If/when they do I’ll post an update.

If you’d like to see how CleanSlate can help you take full advantage of your Salesforce org please shoot us an email!