Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
NetSuite Tip - Customized html alert popup
Scenario: Show a popup mentioning insufficient credit limit balance on SO.
Refer the below code for reference. Here uses a html alert popup and embedded into a inlinehtml field.
const PENDING_APPROVAL = 'A';
const beforeLoad = (scriptContext) => { if (scriptContext.type === scriptContext.UserEventType.DELETE) return;
try {
let soForm = scriptContext.form;
let soRecord = scriptContext.newRecord;
let status = soRecord.getValue({
fieldId: 'orderstatus'
});
let soCus = soRecord.getValue({
fieldId: 'entity'
});
let total = soRecord.getValue({
fieldId: 'total'
});
let statusFld = soForm.getField({
id: 'orderstatus'
});
let alert = soForm.addField({
id: 'custpage_alert',
type: serverWidget.FieldType.INLINEHTML,
label: 'Alert'
});
//Alert Box template
const fadingAlertHTML = '<!DOCTYPE html>' +
'<html>' +
Tagged:
1