The N/ui/message module displays inline banner messages at the top of NetSuite pages. It is available in Client Scripts and is used to show status messages, warnings, errors, or informational notes without a dialog popup.
Showing a Message
define(["N/ui/message"], (message) => {
const pageInit = () => {
const myMsg = message.create({
title: "Record Loaded",
message: "This record was last modified by a scheduled script.",
type: message.Type.INFORMATION
});
myMsg.show({ duration: 5000 }); // Auto-hide after 5 seconds
};
return { pageInit };
});
Message Types
| Type | Appearance | Use Case |
|---|---|---|
message.Type.INFORMATION | Blue banner | General info messages |
message.Type.CONFIRMATION | Green banner | Success confirmations |
message.Type.WARNING | Yellow banner | Cautionary notices |
message.Type.ERROR | Red banner | Error notifications |