Dynamically Add Custom Button Using User Event Scripts
Published on
August 31, 2023 at 9:14:10 AM PDT August 31, 2023 at 9:14:10 AM PDTst, August 31, 2023 at 9:14:10 AM PDT
Scenario
A user wants to dynamically add a button in a record using aUser Eventscript.
Solution
DeployUser Eventscriptthat will display the button
CreateJavaScriptfile with the following code:
Navigate toCustomization>Scripting>Scripts>New
Click+
Select File:ClickBrowse...
SelectJavaScript file
Note:Select JavaScript file created from Step 1.1.ClickOpen
ClickCreate Script Record
Basic Information:
- Name:EnterAdd Button
- ID:Enter_add_button
Deployments tab:
- Applies To:SelectEmployee
- ID:customdeploy_add_button
- Status:SelectReleased
ClickSave
UploadClient scriptthat serves as the custom button's logic
CreateJavaScriptfile with the following code:
Navigate toDocuments>Files>SuiteScripts
ClickAdd File
SelectJavaScript file
Note:Select JavaScript file created from Step 2.1.ClickOpen