Shannon
10/14/2024, 6:23 AMCeligo AI
10/14/2024, 6:23 AMAI generated answer (using internal Slack threads):To add an edit button to a Payment, you can use SuiteScript's
Sublist.addButton
method. This method allows you to add a button to a sublist on a record. However, this method is only available in client scripts and user event scripts.
Here is a sample code snippet:
javascript
function userEventBeforeLoad(scriptContext) {
if (scriptContext.type !== scriptContext.UserEventType.VIEW)
return;
var form = scriptContext.form;
var sublist = form.getSublist({
id: 'your_sublist_id' // replace with your sublist id
});
sublist.addButton({
id: 'custpage_edit_button',
label: 'Edit',
functionName: 'editFunction' // replace with your function name
});
form.clientScriptModulePath = './your_script_file.js'; // replace with your script file path
}
In the client script file, you can define the function that will be called when the button is clicked:
javascript
function editFunction() {
// your code here
}
Please note that you need to replace 'your_sublist_id'
, 'editFunction'
, and './your_script_file.js'
with your actual sublist id, function name, and script file path, respectively.
******
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
10/14/2024, 6:24 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817561746
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81417948
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814097941
Celigo AI
10/14/2024, 6:24 AM