Custom Button Breakdown

CustomButtonApocalypse-300x230

Did you know…

  • Custom Buttons that pass data via URL (aka URL Hacking) are ‘frowned upon’ by Salesforce and not supported?
  • At any time, a variety of changes made by Salesforce.com could BREAK these buttons?

When this happens, you’ll need to be able to understand what your buttons are doing,  as you’ll need to create the functionality another way without disrupting the business.

It’s time for a Custom Button breakdown.  Here is an example of a button on a Case that creates an Opportunity.

/500/e?RecordType=012800000003iXA&retURL=%2F500%3Ffcf%3D00B80000008A6pP &CF00N80000003Suly={!Opportunity.Name}&CF00N80000003Suly_lkid={!Opportunity.Id}&cas4={!Opportunity.Account}&00N30000002AJuy{!Opportunity.Customer_Account_ID__c}&00N80000004Jmha={!Opportunity.Product_Name__c} &00N800000050WMq={!Opportunity.Some_Picklist__c}&00N800000050VAI={!Opportunity.Some_Field__c}

Do you look at this and just see a jumble of code?  There was a time when I did too, but it’s actually super easy.  Let’s first break this out into lines.  If you’re lucky, your buttons already appear this way.

/500/e?
RecordType=012800000003iXA
&retURL=%2F500%3Ffcf%3D00B80000008A6pP
&CF00N80000003Suly={!Opportunity.Name}
&CF00N80000003Suly_lkid={!Opportunity.Id}
&cas4={!Opportunity.Account}
&00N30000002AJuy={!Opportunity.Customer_Account_ID__c}
&00N80000004Jmha={!Opportunity.Product_Name__c}
&00N800000050WMq={!Opportunity.Some_Picklist__c}
&00N800000050VAI={!Opportunity.Some_Field__c}

Now I’ll explain each line.

/500/e

  • ‘500’ is the Salesforce ID of the Case Object 
  • e means Edit Mode.  
  •  Translation: “Open a Case in edit mode’

 

RecordType=012800000003iX

  • 012800000003iX is the Case Record Type ID. 
  • Translation: “For this new Case, use this record type”

 

&retURL=%2F500%3Ffcf%3D00B80000008A6pP

  • This line is just directing the URL where to go if the user cancels or needs to go back to the record they were on.

 

&CF00N80000003Suly={!Opportunity.Name}
&CF00N80000003Suly_lkid={!Opportunity.Id}

  • CF stands for Custom Field
  • CF00N80000003Suly is the field ID of your Opportunity lookup field on the Case object
  • _lkid   –  means “lookup ID”
  • {!Opportunity.Name} & {!Opportunity.Id}   These are the fields on the Opportunity the data is coming from, same as email templates. 
  • Translation: “The Opportunity lookup field on the new Case will be this  Opportunity”

 

&cas4={!Opportunity.Account}

 

&00N30000002AJuy={!Opportunity.Customer_Account_ID__c}
&00N80000004Jmha={!Opportunity.Product_Name__c}
&00N800000050WMq={!Opportunity.Some_Picklist__c}
&00N800000050VAI={!Opportunity.Some_Field__c}

  • The rest are easy, just more custom field ID’s for the Case Object and the source field from the Opportunity.  Remember the format:  &Case Custom Field ID = {!Opportunity Field value}

 

There could be minor variations of these URL Custom buttons, but if you understand this much, you’ll be all set.   So now what are you supposed to do?  It’s time to convert these buttons to Javascript (I think they’ll be OK) or Actions my friend!

One thought on “Custom Button Breakdown

  1. I was literally working on a custom button and stumbled across your blog. Dude keep it up. That was perfectly enlightening!
    -daniel

Leave a Reply

Your email address will not be published. Required fields are marked *