Activity Forums Salesforce® Discussions Explain the difference between a custom button and a custom link.

  • madhulika shah

    Member
    September 7, 2018 at 11:42 am

    Hi Anjali,

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

    Custom links can link to an external URL, such as www.google.com, a Visualforce page, or your company’s intranet.Custom links can also link to a custom s-control in the custom s-control library, such as a Java applet or Active-X control whereas Custom buttons can:

    • Connect users to external applications, such as a web page that displays a map to a contact’s address.
    • Run an s-control from the s-control library, such as an s-control that escalates a case from the case detail page.
    • Launch custom links.

    Hope this helps.

     

  • Avnish Yadav

    Member
    September 7, 2018 at 12:39 pm

    Hello,

    Custom Button and Custom Link defines the action that occurs when a user clicks a custom button or link. Custom buttons and links can streamline actions within Salesforce or integrate Salesforce data with external URLs, applications, or systems

    Difference -

    • Custom links can link to an external URL, such as www.google.com, a Visualforce page, or your company’s intranet.
    • Custom links can also link to a custom s-control in the custom s-control library, such as a Java applet or Active-X control.
    • Custom buttons can connect users to external applications, such as a web page that displays a map to a contact’s address.
      Custom Button can run an s-control from the s-control library, such as an s-control that escalates a case from the case detail page.

    Hope this will help

    Thanks.

  • Parul

    Member
    September 7, 2018 at 12:54 pm

    Hi Anjali,

    Custom Link:

    • Custom links can link to an external URL, such as www.google.com, a Visualforce page, or your company’s intranet.
    • Custom links can also link to a custom s-control in the custom s-control library, such as a Java applet or Active-X control.

    Custom Button:

    • Connect users to external applications, such as a web page that displays a map to a contact’s address.
    • Run an s-control from the s-control library, such as an s-control that escalates a case from the case detail page.
    • Launch custom links.

     

    Thanks.

  • shariq

    Member
    September 10, 2018 at 12:49 pm

    Hi,

    Implementation Tips :
    Custom buttons display at the top and bottom of the detail page to the right of all standard buttons.
    Custom buttons aren’t distinguished from standard buttons in any graphical way. However, you can recognize them by their location on the right of all standard buttons.
    If the button bar gets too wide on the detail page layout, the browser displays a horizontal scroll bar. If the button bar gets too wide on the list view, search result, tagging result, or related list layouts, the buttons wrap.
    Custom buttons are available for activities under the individual setup links for tasks and events. To add a custom button to an activity list view or search layout, first create a custom list button in tasks or events. Next, add it to your activity list view or search result layouts. You can override a button that applies to both tasks and events.
    Person Account records use the custom buttons and links you have made for accounts.
    If your organization uses the Console tab, list buttons are available in Mass Action. List buttons don’t display in the mini page layouts. Pages that display due to custom buttons and links display in the console without the header or sidebar.
    If you get an error message when overriding a button that appears in a list, try calling the s-control using the URLFORfunction.
    When creating custom buttons, be aware of any validation rules your organization has for records on that object. For example, a custom list button that changes case status may conflict with a case validation rule. In this scenario, Salesforce displays the error message for the validation rule when users click the custom button.
    To replace a standard button with a custom button, first define the custom button, then customize the page layout to hide the standard button and display the custom one in its place
    Visualforce pages used as custom links on the home page can’t specify a controller.
    Visualforce pages used as custom buttons or links on detail pages must specify a standard controller of the same object.
    Visualforce pages used as custom list buttons must use a standard list controller of the same object.
    A Web tab or custom link could display a blank page if the embedded site:

    Has been set to deny the loading of its content in a frame.
    Has been set to allow the loading of its content in a frame only if the same site is delivering the content.
    Contains a mix of secure and unsecure content, and the user’s browser has been configured to block mixed active content.

    To resolve this issue, try these workarounds.

    Set your custom link to either open in a new window or display in the existing window without the sidebar or header.
    Move the URL from a Web tab into a custom link instead, and set the URL to either open in a new window or display in the existing window without the sidebar or header.
    If the site you’re embedding has an HTTP prefix and mixed active content, try changing the prefix to HTTPS. If the embedded site has a valid security certificate and it hasn’t blocked itself from being displayed in frames, using HTTPS as the prefix allows the site to display.

    Best Practices
    Use formula functions in custom buttons with caution. Because functions run on the server before your HTML or JavaScript is passed to the browser, they can only evaluate information that exists at that time. Avoid using functions like IF to evaluate conditions that only exist when the code reaches the browser, such as the value of a JavaScript variable that is returned from your code.
    To prevent a user from performing a particular action, such as creating or editing, change the user's permissions rather than hiding the standard button. Hiding a standard button removes it from a page layout, but the link is still available and users can navigate to the new or edit page manually.
    Use global variables to access special merge fields for components like custom buttons, links, and s-controls. For example, the $Request global variable allows you to access query parameters inside a snippet, s-control, or custom button.
    Don’t select Display Checkboxes (for Multi-Record Selection) for list buttons that link to a URL that doesn’t support post operations. Checkboxes display next to records in a list if you have selected Display Checkboxes (for Multi-Record Selection) for at least one list button in that list. However, selected records in this list are unaffected when clicking a custom list button that doesn’t have this option selected.

    Limitations
    A custom link’s label can’t exceed 1,024 characters.
    A link URL can be up to 2,048 bytes. When data is substituted for the tokens in the URL, the link can exceed 3,000 bytes. Some browsers enforce limits on the maximum URL length.
    Custom buttons that call JavaScript aren’t supported in Lightning Experience.
    Custom buttons with a content source of OnClick JavaScript aren’t supported in the Salesforce app.
    Using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as pre-populating fields when creating a record—doesn’t work in the Salesforce mobile app or Lightning Experience.
    On record detail pages for external objects that are associated with high-data-volume external data sources, custom buttons and links that call JavaScript aren’t supported.
    Custom buttons aren’t available for Web-to-Lead, Web-to-Case, the Case Teams related list, or the user object.

    Hope this helps!

  • chanchal kumar

    Member
    September 10, 2018 at 2:13 pm

    Custom links can link to an external URL, such as google, a Visualforce page, or your company’s intranet. While custom buttons can connect users to external applications, such as web pages, and launch custom links.

     

Log In to reply.

Popular Salesforce Blogs