• WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Salesforce
        • Implementations
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service Lightning
          • Field Service for SMEs
        • Developments
          • Salesforce Customization
          • Custom Application Development
          • AppExchange Product Development
        • Migrations
          • Classic to Lightning Migration
          • Other Systems to Salesforce Migration
        • Integrations
      • Data Science
        • BI Solutions
        • AI/ML solutions
        • Agentic AI
    • HOW WE DO
      • Delivery Model
      • Our Works
    • REACH US
      • Contact Us
      • Careers
    • BLOG
  • [email protected]
  • (+91) 44-49521562
Merfantz - Salesforce Solutions for SMEs
Merfantz - Salesforce Solutions for SMEs
  • WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG

Part I – 6.Types of Buttons in Salesforce

  • November 2, 2017
  • Merfantz Editor
  • Salesfore Training Course, 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.

Custom Button

 

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

Author Bio

Merfantz Editor
+ Recent Posts
  • August 4, 2023
    How to Setup CRM Analytics for Financial Services Cloud
  • August 2, 2023
    How to Get Started with Salesforce Hyperforce - Merfantz
  • July 28, 2023
    Health Cloud Mastery: Salesforce Trailhead for Effective Healthcare CRM
  • July 26, 2023
    How to integrate Data cloud and Marketing cloud In Salesforce
  • Previous Part I – 5.How to Create a Custom Object Tab in Salesforce
  • Next Part II – 1.User Creation in Salesforce
Merfantz Technologies is a leading Salesforce consulting firm dedicated to helping small and medium enterprises transform their operations and achieve their goals through the use of the Salesforce platform. Contact us today to learn more about our services and how we can help your business thrive.

Discover More

Terms and Conditions
Privacy Policy
Cancellation & Refund Policy

Contact Info

  • No 96, 2nd Floor, Greeta Tech Park, VSI Industrial Estate, Perungudi, Chennai 600 096, Tamil Nadu, INDIA
  • (+91) 44-49521562
  • [email protected]
  • 9:30 IST - 18:30 IST

Latest Posts

Salesforce API Integrations: Connect with Slack, Zoom, and Teams May 2, 2025
Guide to Streamlining Sales Success
Mastering Salesforce CPQ: A Comprehensive Guide to Streamlining Sales Success April 17, 2025
Unlocking Salesforce Data Cloud: Unify and Activate Customer Data April 4, 2025

Copyright @2023 Merfantz Technologies, All rights reserved