Friday, November 20, 2015

Fun with Formulas: Clickable Links

Clickable Links; How To:

One of my favorite tricks to use with formula's is creating a clickable link. Often I find that I want to have the link visible in a list view or in a report, in these scenarios a "Custom Link" just won't do. For this I look to creating a clickable link.

How is this helpful?

In many different ways this can be helpful or applicable. Imagine, you are a Sales rep, as a good sales rep does, you have a report of your top 100 clients. Each one of these is a contact, whom you want to stay in touch with regularly. The traditional way of handling this in Salesforce would be to click into each contact from the report, call them, and add the task to the contact saying that you have just called then and what you talked about. What if you could click on a custom link from the report called, "New Call" that would create a new task Record with various data points about the contact right from the report?

That would be a game changer, right?

How can I do it?

The execution is quite simple. I'll outline it in the following steps:
  1. Create a Formula Field (Type Text)
  2. Add the Merge Field Values to the formula
  3. Add the Hyperlink Syntaxt to your formula
  4. Expose to users/Add to a report.
Now that we know the overview, let's walk through this.

Walkthrough:

Step one, you should be familiar with, creating a new formula field of type text as shown below. We want to make sure that you put this field on the Contact object so that it can be exposed on Contact reports to fulfill the example scenario given above. Here's what it looks like so far:


Notice that I've named my field, "New Call" as to help my end users find it easily when adding it to reports. This way they know exactly what the field is for, simply by making my naming make sense. I didn't call it "New" which would be confusing to my end users as they don't know what they are creating that is "New".

Now on to the formula, what do I need to create a new task record in salesforce? 

This part is simple, and you can do it by looking into your address bar when you go to create a new task. 


Notice the "/00T/e" this is what will place my browser in the "Edit Mode" for the creation of a new Task. The /e is salesforce for "Edit" and the /00T is salesforce for "Task" all standard objects have something similar to this when you create new.

So I know I want my page to go here, so I'll add this to my formula. I'll also add the ? to my formula as this is necessary to begin passing in my field values to my new task I'm creating.

So far my formula is very basic, it looks like this:


But I don't want this formula because it would only display the text of "/00T/e?" which would mean nothing to my end users. I want this formula to be valuable, so the next thing I'm going to do is start adding my parameters that I want my URL to pass into my new task. I can do this with merge fields. If you remember the URL from above, you can look and see that a few fields are bing populated already for me. Can you tell which ones?

If you guessed, "Subject" and "Contact" you would be correct, and I would be impressed that you figured that out. It's not so simple with tasks as with other objects. There is a lot going on in this URL. Let's break it down so we understand it:


Well, we allready know that /00T/e? is creating a new task, putting us on the edit page and is ready for input value parameters to be passed.

What does, "title=Call" mean? Well, it means that you are creating the "Call" type of task. The same one you would get when you click on the "Log a Call" link from a Task related list. This also sets the status of the activity to "Completed" by default, so your users just need to fill in details.

Next, what is the "who_id" and what does that mean? Simplistically, that is the "Name" field, and the id you are passing is the id of the contact. This will auto-populate the contact in the Name field for you.

What is "followup=1" and what does it mean? The followup=1 is what allows you to create a follow up task at the same time as logging your call. You can remove this and just have your users log the call with no follow up.

Next is "tsk5=Call", this is the cryptic name for the "Subject" field. Very intuitive right? Right, well at any rate you are pre-populating the subject line for your end users. You could change this if you would like to "Call to Client", instead of "Call". Or "Phone Call" or anything you'd like really.

Finally, last but not least is the return URL. Where should your users be dumped after they have clicked save or cancel? Right now it's pointing to the contact record id. Meaning it will place them on the contact record. I could put this to the report id if I wanted, or the home page or anywhere else. For our example I will put it to the contact record as it makes the most sense to me. In order for this to work we have to include the %2F in quotes before the merge field Id. 

Here is how my formula looks now that I've added the above parameters:

Notice the quotation marks and the & that I've added. The quotation marks are going to be important in making the breaks between exact text that you want to pass into the URL and the merge fields that you have. For example, the first set of quotation marks starting at "/00t...and ending at id=" allows me to then put in the merge field of Id. Since I'm creating this on the Contact object, it will be the contact Id. The & symbol is used to connect the various pieces of this formula. If you don't get these right the formula will not work.

As you can see I have "&Id&"&. This is essentially connecting my merge field to the front and back halves of the URL. The third & symbol is a continuation of my URL so that I can add another field that I want to populate. You MUST do this everywhere that you are going to populate fields with a merge field. That said, note that my last merge field at the end of the URL is simple "&Id. Effectively I've ended the URL so I don't need to attach it to anything else.

Now that I've added all of my merge fields, we simply want to make this a HYPERLINK formula so that the link will be clickable. I can do that by selecting the HYPERLINK formula on the right in the formula box. Then select insert function:


You should get a pre-formatted formula that looks something like this:

We are going to take and replace the part that says, "url" with the url that we have just built in the above steps. Then we are going to replace "friendly_name" with "Create New Call" (make sure to include the quotation marks. Finally we are going to remove the square brackets and replace the word target with "_parent". This will allow the link to open in a new window. If you want it to open in the same window you can use "_self" instead.

Here is what that looks like:

Now you've created the field. You want to make it visible to all of the users that you want to be able to use it, but you probably don't want to put this on a page layout. This is better used in list views or in reports so that the sales users can have a list of contacts they are contacting and work their way down the list.

Wednesday, January 29, 2014

Email to Case: Specify From Addresses and Setting up Case Feed

The Question:

So this is a simple one, but the question seems to come up all the time, especially with people who are less familiar with Service Cloud. Can I specify the "From" address on case emails so it doesn't default to the Agent, but rather to a address that makes sense like, "Support@mycompany.com"?

The Answer:

Yes!

How?

Good question. The easiest way, is to use the coolest Service Cloud Feature. It's called, Case Feed. Haven't heard of it? Shame on you! It's fantastic, and will make your Techs lives better. Check it out today! 
I digress, the great thing about Case Feed is that it allows you to specify in the individual page layout the ONLY email addresses allowed as shown below, here's how I did it:

1-) ENABLE CASE FEED! This  might be the hardest step for many of you. But don't be intimidated, all of your existing case page layouts, record types...etc will stay intact even if you enable case feed. Also, you can have it on a user by user basis, so some users see case feed, and other users see the standard case page layout!

To Enable case feed go to Setup->Customize->Cases->Support Settings here you will check the checkbox that says, "Case Feed Enabled"

Ok, now it's enabled. What next?

2-) Next you'll have to  setup your page layout and record type. If you navigate to the case page layouts you'll see a new section. It looks like this:
The key here is to notice the middle section. Page Layout for Case Feed Users. It's telling that it says, "FOR CASE FEED USERS" this is Salesforce's way of telling you that only certain users will see these page layouts.  Also you should notice the little drop down arrow.

If your anything like me and come across something like this in Salesforce you have to click it, which you should do anyway.

You'll now be presented with three options:

  • Edit Feed View
  • Edit Detail View
  • Delete
Delete is straightforward and we'll skip that. Edit Detail View is going to be the "Detail" part of your new case feed. Or in other words where you add and remove fields.

The Feed View is where you get to introduce cool new stuff! Primarily where you can specify the "FROM ADDRESS(ES)". This is shown below:


Now that it's set your outcome should look like this:



Look how pretty! It defaults to my support address now. I didn't have to do anything else.


Notice that when I click on the drop down there is no other option available. Not even my own address. No longer do I have to worry about clients responding to an email from a tech and it going into the Technicians personal email box! It will always come back to salesforce.

The last thing that you want to do in setting up case feed is start to enable it for end users. To do that there is two things.
  1. Ensure that the new "Case Feed Page Layout" is assigned to a record type. (Just like you would any other page layout)
  2. (And this is VERY important), From the PROFILE update the "Use Case Feed" permission to TRUE.

That's it. You've both now enabled Case Feed, and narrowed the available Emails for a single page layout. Your support center can now send and receive emails flawlessly with Clicks and Not Code!






Tuesday, January 28, 2014

Formula How To's: How do I extract an exact value from a comma separated list?

How do I extract an exact value from a comma separated list?

Recently, I was presented with the challenge of trying to extract an exact value from a comma separated list. In my scenario, I was trying to identify that one of the values in the list, was an exact match to a specific value on the current user's record. 

Why would I want to do this? Specifically, this allows me to use a "True" or "False" value in a list view, report or dashboard to display records. This presents the idea of a "dynamic" list, report or dashboard that is specific to the user viewing the list, report or dashboard without changing the data or the parameters thereof. 

Scenario:

As previously stated, I had a field that was a concatenated comma separated list. In my scenario this field was being set by a trigger, but regardless of how the data gets in the field the idea is the same. Next, I had a field on the user record that may have been a value in the comma separated list at anyone time on any given record. 

Formula:


AND(
If( 

/*Checking to see if the initials are here at all*/
Contains(Field_Im_Looking_at__c,$User.User_Field_value__c)
, True, False),
OR(

/*Checking for an exact match in the first set of values*/
IF(Find($User.User_Field_value__c+',', Field_Im_Looking_at__c)>0, TRUE, False),

/*Checking for an exact match somewhere in the middle. */
IF(Find(','+$User.User_Field_value__c+',', Field_Im_Looking_at__c)>0, TRUE, False),

/*Checking for an exact match at the end of the string */
IF(TRIM(RIGHT(Field_Im_Looking_at__c, LEN($User.User_Field_value__c))) = $User.Field_value__c, TRUE, False)
))

Break it down:

Ok, so breaking down this formula, I've changed the field names to "Field I'm Looking At" and "User Field Value" for simplicity sake. In the "AND" statement, I am looking to see if the value even exists within my set of values, and then the second condition contains my "OR" statement which searches for my exact value. You might not need the "AND" statement at all, and could probably do this with just the "OR" statement, but this worked for me and so I kept it like that.

Within the "OR" statement, I am checking for three conditions. They are:
  1. Is my value the first value in the list?
  2. Is my value a middle value in the list?
  3. Is my value the last value in the list?
The first two values are fairly easy to search for because I know that my value will look like: "VALUE," or ",VALUE," it's important to recognize the commas here. They are what ensure you are getting the exact value and not a partial value.

Note: If you have the scenario where a partial is possible with the end of the value (or in other words the first value in your list has a potential for being a partial), you might want to modify the first if Statement to be something like:

IF(Trim(Left(Field_Im_looking_at__c, LEN($User.User_Field_value__c))) = $User.User_Initials__c, TRUE, False)

In my scenario this wasn't possible and so I did not account for it.
What does that do? Well, simply it takes the value from the user record and trims everything but the number of characters for the value you are looking for. It then will compare the two values to see if they are a match. If they are, then you get a "True", if not you get a "False".

Application for use:

Now that I have this formula, I inserted it into a Formula Check box field. Now my users can leverage this field in list views simply looking for a "True" or "False" value to know if the records are applicable to them. This cuts down on a lot of complex reports and filtering for my end users. I hope it's helpful to you and as always this is one more thing that you can do in clicks and not code.

Tuesday, May 21, 2013

Summer '13 Release Series: Customizable Price Books

Customizable Price Books:

Price books in Salesforce have always been a bit limiting. They have been static and difficult to use because you couldn't customize them. Well with Summer '13 that is all going to change. Now you can add fields, track history, validation rules, field sets, record types, and triggers on Price Book records. There is also a handy dandy new Price Books Tab in Summer '13 (But you do have to enable it if your org isn't new).

  1. Adding new fields or updating Price Books is just like you would for any other object. Go to Setup->Customize->Price Books
  2. Adding the new Tab is something you don't really need to do that often in Salesforce. Usually it just appears and all is good with the world. In this case you have to "Enable" it. Which is odd, but whatever. Here's what you do: 
    1. Pull up the profile that you want to enable the tab for, then click edit. 
    2. Go to the tabs section and find Price Books. Change the Tab value from "Default Off" to "Default On" and it will become visible.
With the Salesforce Summer '13 release this is just one more thing that you can now do in Clicks and not Code.

Monday, May 20, 2013

Summer '13 Release Series: Opportunity Splits

Opportunity Splits:

In the Salesforce.com Summer '13 release it is now possible to create Opportunity Splits. This is a feature long waited for, that we have seen hit pilot once before but was never official G.A. Now it is, and here is what you need to know:
  1. There are two different kinds of opportunity splits. They are:
    1. Revenue Splits, which must equal 100% of the opportunity amount. These are typically to be shared across those who have direct influence on the sale.
    2. Overlay Splits, these are to be shared with anyone who helps in the sale, but may not have direct influence on the revenue. This can be any percentage of the actual opportunity total up to and even exceeding 100%
  2. Now that we know about the kinds of splitting, how do we set it up? Well, first we need to enable Team Selling as Splits and Team Selling go hand in hand. You do this by going to
    Setup->Customize->Opportunities->Opportunity Teams->Settings. Click the "Enable Team Selling" checkbox as seen below:
  3. You'll then have the ability to add the  Opportunity Team Related List to the Page Layouts that you have for Opportunities. You can do this later if you don't do it now.
  4. You also now have an expanded menu within Opportunity Teams that includes the "Opportunity Splits" category as seen here:
  5. This is where you can "Enable Opportunity Splits", doing so presents you with a few options and one big yellow box. These boxes and warnings like this usually are important. Make sure you read this before proceeding.
  6. If you desire you can edit the labels of the types of splits to have names that match your organization here.
  7. Click Save. You've now enabled opportunity splits for your organization, and all opportunities going forward will have them included.
This is just another way that you can provide additional features and functionality for your Sales Teams using Clicks and Not Code.

Friday, May 17, 2013

Summer '13 Release Series: Forecasting Using Quantities

As part of Summer '13 Salesforce has finally released the ability to use customizable forecasting with Quantities. This is long overdue. Here's how you can set it up:

  1. Go to Setup->Customize->Forecasts->Settings. You will need to ensure that Forecasts are first Enabled for the Org by clicking this checkbox:
  2. This will then enable a lot of options for you. Specifically under "Data Source" you now see a new checkbox for "Quantity" as shown below. Make sure to enable this.
  3. You need to make sure that you are using products and price books so that you can add opportunity line items in order for quantities to be part of the Oppty total. Once you have created an opportunity with an associated product which  has it's quantity, you can see that in your forecast as seen here. You must use the drop down on the right to see quantities as at first it will display the dollar amounts as usual:
  4. That's all you have to do to enable Quantity based forecasting, but if you are setting up forecasting for the first time, you want to look at the other settings closely to ensure that they work for you and your business.
This is just one more thing that Salesforce has made possible for you to do in Clicks not Code.

Thursday, May 16, 2013

Summer '13 Release Series: Improved Setup User Interface

Improved Setup User Interface:

The new improved setup user interface is actually quite nice. It is a feature with Summer '13 that can be found in Setup->Customize->User Interface. It is located at the bottom and is labeled as "Enable Improved Setup User Interface." But what does it do?

Here are the changes you will notice if you enable this feature:

  1. Setup will change. The layout of the sections on the left hand page will change. See this side by side comparison:
  2. Your upper right Menu bar will change. Setup is now broken out, for those who can see setup and config. Other end users don't see Setup, but do see My Profile and My Settings.
    1. Admin Users See:
    2. End Users See:
  3. Finally, what does My Settings look like? Well it's completely different and if you ask me a direction that Setup should take in general. Hopefully that's the plan for SFDC as we all know that Setup was due for a UI overall five years ago. Here's the landing page:
As you can see, this is a much cleaner interface with a more Web 2.0 view. This makes the end user experience much more cohesive. From what I can tell the options are all the same, as the old "My Settings" but the interface is just a lot nicer. This is yet another thing that you can do in Summer '13 release in Clicks Not Code.