32
Custom Links & Buttons in Salesforce Sometimes users just need a button! Raleigh Salesforce User Group Amber Neill Salesforce.com Administrator iContact.com [email protected] [email protected] http://www.twitter.com/amber9904

Custom Links Buttons In Salesforce Com

  • View
    28.965

  • Download
    0

Embed Size (px)

DESCRIPTION

Driving adoption in Salesforce.com can be a full time job. The easiest way is to automate work for your users. Custom buttons and links take away some of the "busy work".

Citation preview

Page 1: Custom Links Buttons In Salesforce Com

Custom Links & Buttons in Salesforce

Sometimes users just need a button!

Raleigh Salesforce User Group

Amber NeillSalesforce.com [email protected]@gmail.comhttp://www.twitter.com/amber9904

Page 2: Custom Links Buttons In Salesforce Com

First things first...

To create or change custom buttons or links, you'll need  “Customize Application” permissions for your profile.

Page 3: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

Business Problem: We have resellers who sell our widgets.  We need to know how those resellers are doing.Who has account X referred?What is the total revenue account X has generated for us?

Page 4: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

What we need: • Two fields on the Account object:

o ClientID - unique identifier for an account (5 digit #)o ReferrerID - the ClientID of the account that referred

this account (5 digit #)

Page 5: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

What we need (cont'd):• Account view showing sample data• Accounts to be our referrers

o United Oil & Gas, Singapore  o University of Arizona

Page 6: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

What we need (cont'd):• A report that pulls all Accounts with a given ReferrerID

o Right now this report just pulls accounts referred by the account with the ClientID of 43210.  I'm going to modify the report to make it work across accounts

 

Page 7: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

Steps to Create the Link 1. Modify the report to take OUT the specific ReferrerID

     Save this report with the "Save and Return to Report" button.  We need the URL of the report.

Page 8: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

2. Take the URL of the report  https://na6.salesforce.com/00O80000003uWeY  and save it off someplace safe.  You'll need it shortly. The part of the URL after "https://na6.salesforce.com/" is the unique ID for your report.  We'll use that to create our link.

Page 9: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

3. Go to Setup | Customize | Accounts | Buttons and Links  4. Click New 5. Give your link or button a Label, Name and Description 6. For this link we're going to choose Detail Page Link, we want it to Display in new window, and the Content Source will be URL. Now the fun begins...

Page 10: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

7. Remember that URL you saved off?  Paste it in the Formula area

8. Take off the "https:na6.salesforce.com and add the following to the end of the URL:    ?pv0={!Account.ClientID__c}

This tells the link to add the merge field of ClientID as the first criteria for the report.  (pv0 is the first criteria, pv1 is the second criteria, etc.)  Use the "&" symbol between criteria if you're using more than one.

Page 11: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

And here's your URL for your custom link:

/00O80000003uWeY?pv0={!Account.ClientID__c} 

9. Click SaveHere's what the page looks like with all our settings...

Page 12: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

 

Page 13: Custom Links Buttons In Salesforce Com

Adding a Report to an Account

10. Insert your new link into your page layout(s) 11. Test your report

o United Oil & Gas, Singapore  o University of Arizona

 

Page 14: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

Business Problem:If a customer is unhappy with service, let's send them some flowers!

Create a button that creates a new case with several fields populated

Page 15: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

I'm going to do this a bit backwards...

Here's the URL:

/500/e?RecordType=01280000000HZp8&cas3_lkid={!Case.ContactId}&00G80000001xVfS={!Case.OwnerId}&cas11="Empowerment_Kit_Button"&00N80000004SxUh={!Case.OwnerFullName}

Let's break it down into the pieces

Page 16: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

 First, let's pull the URL apart. • /500/e• ?RecordType=01280000000HZp8• &cas3_lkid={!Case.ContactId}• &00G80000001xVfS={!Case.OwnerId}• &cas11="Empowerment_Kit_Button"• &00N80000004SxUh={!Case.OwnerFullName}

Page 17: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

Now, here are the parts explained

/500/e This creates a new case (500) in edit mode (e).

Page 18: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

Next, let's tell our new Case what Record Type is should be. •  ?RecordType=01280000000HZp8

"RecordType" is obvious.  We're telling the new object to have a record type with the ID of "01280000000HZp8" I got that ID from going to the record type in Setup | Customize | Cases | Record Types and right clicked to get the link.  See the "id=" in the URL?  The 15 digits after that is the Record Type ID.   Remember this technique for later!

NOTE: The ? tells the URL that this is the first parameter.  We'll use & to separate subsequent parameters

Page 19: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

 Next, we'll tell the new Case who the related Contact is.   •  &cas3_lkid={!Case.ContactId}

 We know the existing Case's ContactID, we're going to assign it to cas3_lkid (this is the id for the new Cases's ContactID).

Resource: Standard Fields for Custom Links & Buttons

Page 20: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

Ok, let's designate who owns this case. • &00G80000001xVfS={!Case.OwnerId}

 We want the "Empowerment Kit" queue to own this case when it is first created.The code there is the ID for the "Empowerment Kit" queue.  I got it the same way I get other IDs (via the URL)

Page 21: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

I want these new cases to have a specific Case Origin. • &cas11="Empowerment_Kit_Button"

 The code for Case Origin is "cas11".  Got this from the list of standard field IDs.

Page 22: Custom Links Buttons In Salesforce Com

Creating a New Case from an Old One

Finally, let's specify the requester of the new case as the original case's owner. • &00N80000004SxUh={!Case.OwnerFullName}

The code there is the ID of the Case Requester custom field.

Here's a test case.

Page 23: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Business Problem:Outbound call center often gets bad phone numbers.  Let's facilitate them quickly closing those Opportunities so they can get to the next call.

Create a button that closes the Opportunity with some of the fields filled in.

Page 24: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Here's the URL and it broken down:

/{!Opportunity.Id}/e?retURL={!Opportunity.Id}&opp11="Closed Lost"&00N80000004T0Gh="Wrong/Bad Number"&save=x

• /{!Opportunity.Id}• /e?• retURL={!Opportunity.Id}• &opp11="Closed Lost"• &00N80000004T0Gh="Wrong/Bad Number" • &save=x

Page 25: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Let's start by telling the button what record to act on.

• /{!Opportunity.Id} This says to the URL, open this Opportunity.

Page 26: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Now, what do we want to do with this opportunity?

•  /e? All this tells the URL is "We want to edit this opportunity".

Page 27: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Next, we need to specify where to take us when we're done.

• retURL={!Opportunity.Id} We're saying that when all's said and done, take me back to the detail page for this opportunity.

Page 28: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

Here's the meat of this custom button.

• &opp11="Closed Lost"• 00N80000004T0Gh="Wrong/Bad Number"

 This is the same as the last button, one standard field being mapped (Opportunity Stage = opp11) & one custom field being mapped (Opportunity Lost Reason = "Wrong/Bad Number"

Page 29: Custom Links Buttons In Salesforce Com

Quick Close for Opportunities

We don't want to be on the edit page once we're done, so let's save the record.

• &save=x This parameter tells the URL to make the edits and save them.  Now, we're taken back to the ReturnURL (retURL) we specified earlier.

Here's a test Opportunity.

Page 30: Custom Links Buttons In Salesforce Com

Other Ideas for Buttons & Links

• Create Contract from Opportunity (button on Opportunity)• View this Account in External System(link on Account)• Log a Call/Chat (button on Activity)• Retention Opportunity (button on Account)• Send to Tier 3 Support (button on Cases)

Page 31: Custom Links Buttons In Salesforce Com

Other Things to Note

• The maximum length we allow for a Custom Links URL is up to 3000 bytes. When data is substituted for the tokens in the URL, the Custom Link may exceed 3000 bytes. Your browser may enforce additional limits for the maximum URL length.

 • When creating custom links to pass data from one SFDC

filed to another, the data must match the data type of the fields in which you are placing it.  For example, if you have numeric data, you must pass it to a numeric field.

 

Page 32: Custom Links Buttons In Salesforce Com

Custom Buttons & Links = You're a hero!

A custom button or link can be a quick and easy way to become a hero to your users!

Amber NeillSalesforce.com [email protected]@gmail.comhttp://www.twitter.com/amber9904