custom links buttons in salesforce com

Post on 19-Oct-2014

28.965 Views

Category:

Business

0 Downloads

Preview:

Click to see full reader

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".

TRANSCRIPT

Custom Links & Buttons in Salesforce

Sometimes users just need a button!

Raleigh Salesforce User Group

Amber NeillSalesforce.com AdministratoriContact.comamber.neill@icontact.comamber9904@gmail.comhttp://www.twitter.com/amber9904

First things first...

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

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?

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

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

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

 

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.

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.

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...

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.

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...

Adding a Report to an Account

 

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

 

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

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

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}

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

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

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

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)

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.

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.

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.

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

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.

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".

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.

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"

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.

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)

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.

 

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 AdministratoriContact.comamber.neill@icontact.comamber9904@gmail.comhttp://www.twitter.com/amber9904

top related