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 |
-
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}"); - Add the button to the appropriate page layout.