Scenario
A user wants to dynamically add a button in a record using a User Event script.
Solution
-
Deploy User Event script that will display the button
-
Create JavaScript file with the following code:
-
Navigate to Customization > Scripting > Scripts > New
-
Click +
-
Select File: Click Browse...
-
Select JavaScript file
Note: Select JavaScript file created from Step 1.1. -
Click Open
-
Click Create Script Record
-
Basic Information:
- Name: Enter Add Button
- ID: Enter _add_button
-
Deployments tab:
- Applies To: Select Employee
- ID: customdeploy_add_button
- Status: Select Released
-
Click Save
-
-
Upload Client script that serves as the custom button's logic
-
Create JavaScript file with the following code:
-
Navigate to Documents > Files > SuiteScripts
-
Click Add File
-
Select JavaScript file
Note: Select JavaScript file created from Step 2.1. -
Click Open
-