Boris
06/23/2025, 9:57 PMCeligo AI
06/23/2025, 9:57 PMAI generated answer (using internal Slack threads):To add a button in the action menu by a user event script, you can follow these steps: 1. Create a User Event script that adds the button to the form. You can use the
beforeLoad
function in the User Event script to add the button. Here is a sample code snippet:
javascript
function beforeLoad(context) {
if (context.type !== context.UserEventType.VIEW) return;
var form = context.form;
form.addButton({
id: 'custpage_mybutton',
label: 'My Button',
functionName: 'myFunction'
});
}
2. Create a Client Script that contains the function that will be executed when the button is clicked. The function name should match the functionName
you specified when adding the button. Here is a sample code snippet:
javascript
function myFunction() {
// Your code here
}
3. Deploy the User Event script to the record type where you want the button to appear.
4. Deploy the Client Script to the same record type.
Please note that the button will only appear in view mode if you check the condition context.type !== context.UserEventType.VIEW
in the beforeLoad
function. If you want the button to appear in edit mode, you can modify this condition.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
06/23/2025, 9:57 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855379045
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846496403
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843209743
Celigo AI
06/23/2025, 9:57 PM