• WHO WE ARE
  • WHAT WE DO
    • Implementations
      • Salesforce
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service for SMEs
        • Field Service Lightning
      • Salesforce Partner Apps
        • Panda Doc
        • Conga
    • Developments
      • Salesforce Customization
      • Custom Application Development
      • AppExchange Product Development
    • Migrations
      • Classic to Lightning Migration
      • Other Systems to Salesforce Migration
    • Integrations
  • HOW WE DO
    • Delivery Model
    • Our Works
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Implementations
        • Salesforce
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service for SMEs
          • Field Service Lightning
        • Salesforce Partner Apps
          • Panda Doc
          • Conga
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • HOW WE DO
      • Delivery Model
      • Our Works
    • BLOG
Salesforce Blog | Salesforce Simple Tutorial
Salesforce Blog | Salesforce Simple Tutorial
  • WHO WE ARE
  • WHAT WE DO
    • Implementations
      • Salesforce
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service for SMEs
        • Field Service Lightning
      • Salesforce Partner Apps
        • Panda Doc
        • Conga
    • Developments
      • Salesforce Customization
      • Custom Application Development
      • AppExchange Product Development
    • Migrations
      • Classic to Lightning Migration
      • Other Systems to Salesforce Migration
    • Integrations
  • HOW WE DO
    • Delivery Model
    • Our Works
  • BLOG

Part I – 6.Types of Buttons in Salesforce

Salesforce Blog | Salesforce Simple Tutorial > SFDC Training > SFDC Training Part I > Part I – 6.Types of Buttons in Salesforce
  • November 2, 2017
  • Merfantz Editor
  • SFDC Training, SFDC Training Part I
  • 0

Every org has a unique set of business needs. If your users frequently need to access other pages in or outside your org, you can add custom buttons or links directly to object and record detail pages.

Custom buttons or links help you integrate Salesforce data with external URLs, applications, your company’s intranet, or other back-end office systems.

There are three primary types of custom buttons and links that you can create.

  • List button— Appears on a related list on an object record page.
  • Detail page link— Appears in the Links section of the record details on an object record page.
  • Detail page button— Appears in the action menu in the highlights panel of a record page.

 

This List Button example creates a button that can be added to activity-related lists and list views and allows users to delete selected records at the same time.

JavaScript custom buttons are available in all editions. However, the mass delete function described here doesn’t work in editions where the API isn’t enabled.

1. Define a button for events with the following attributes.

  • Display Type─List Button
    • NOTE Select Display Checkboxes (for Multi-Record Selection) so users can select multiple records in the list before clicking the button.
  • Behavior─Execute JavaScript
  • Content Source─OnClick JavaScript
  • Use the following sample code.
{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")} 

var records = {!GETRECORDIDS( $ObjectType.Event )}; 
var taskRecords = {!GETRECORDIDS( $ObjectType.Task)}; 
records = records.concat(taskRecords); 


if (records[0] == null) { 
alert("Please select at least one record.") } 
else { 

var errors = []; 
var result = sforce.connection.deleteIds(records); 
if (result && result.length){ 
var numFailed = 0; 
var numSucceeded = 0; 
for (var i = 0; i < result.length; i++){ 
var res = result[i]; 
if (res && res.success == 'true'){ 
numSucceeded++; 
} else { 
var es = res.getArray("errors"); 
if (es.length > 0) { 
errors.push(es[0].message); 
} 
numFailed++; 
} 
} 
if (numFailed > 0){ 
alert("Failed: " + numFailed + "\nSucceeded: " + numSucceeded + " \n Due to: " + errors.join("\n")); 
} else { 
alert("Number of records deleted: " + numSucceeded); 
} 
} 
window.location.reload(); 
}

2. Add the button to your activity list views.

3. Add the button to any page layout that contains an activity-related list. The button deletes any selected task or event in the list.

We are the ISV Partners and Please reach us for custom development => http://www.merfantz.com


  • Previous Part I – 5.How to Create a Custom Object Tab in Salesforce
  • Next Part II – 1.User Creation in Salesforce
We denounce with righteous indignation in and dislike men who are so beguiled and to demo realized by the charms of pleasure moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound.

Discover More

Contact Info

  • 374 William S Canning Blvd, Fall River MA 2721, USA
  • (+880)155-69569
  • [email protected]
  • 10:00 - 17:00

Latest Posts

Salesforce Marketing Cloud Will Fuel Your B2B Marketing Engine. January 30, 2023
Overview of DML operations in Apex January 24, 2023
Benefits of Integrating Salesforce and Marketing Automation for Business Growth January 20, 2023

2023 All Rights Reserved