Loading
Prepare for Email to Become the Default Login ExperienceRead More
Intermittent freezing when using using certain browser versionsRead More
Extend Salesforce with Clicks, Not Code
Custom Button Example: Display Alerts

Custom Button Example: Display Alerts

This example creates a button that opens a window with a welcome message containing the user's first name.

Required Editions

Available in: Salesforce Classic

Custom buttons and links are available in: All Editions

Visualforce pages and s-controls are available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions

User Permissions Needed
To create or change custom buttons or links: Customize Application
  1. Define a button with these attributes.
    Display Type Detail Page Button
    Behavior Excute JavaScript
    Content Source OnClick JavaScript
    Use this sample code.
    alert ("Hello {!$User.FirstName}");
  2. Add the button to the appropriate page layout.
 
Loading
Salesforce Help | Article