Isaac Rumbold
06/26/2025, 8:18 PMCeligo AI
06/26/2025, 8:18 PMAI generated answer (using internal Slack threads):To trigger a confirmation modal when a record is deleted, you can use a combination of User Event and Client scripts in NetSuite. Here's a general approach: 1. User Event Script: Use a User Event script to hide the native delete button on the record form. This can be done in the
beforeLoad
function of the User Event script.
2. Client Script: Create a custom delete button using a Client script that will be displayed on the record form. This button, when clicked, will trigger a confirmation modal. If the user confirms the action, the record will be deleted.
Here's a simplified example of how the Client script might look:
javascript
function pageInit(scriptContext) {
var currentRecord = scriptContext.currentRecord;
var form = currentRecord.getField({fieldId: 'customform'});
form.addButton({
id: 'custpage_delete',
label: 'Delete',
functionName: 'confirmDelete'
});
}
function confirmDelete() {
var answer = confirm("Are you sure you want to delete this record?");
if (answer) {
var recordId = nlapiGetRecordId();
nlapiDeleteRecord(nlapiGetRecordType(), recordId);
}
}
In this script, pageInit
function is used to add a custom delete button to the form. The confirmDelete
function is called when this button is clicked. It displays a confirmation dialog, and if the user confirms, the record is deleted.
******
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/26/2025, 8:19 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811628282
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.801905513
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.797234535
Celigo AI
06/26/2025, 8:19 PM