You can utilize Form.addPageInitMessage(options) to display a message when users access a record or Suitelet. The user event context allows you to manage when the message appears, such as on records in view, create, or edit modes (excluding Suitelets).
Module belongs to is N/ui/serverWidget Module
Syntax :
scriptContext.form.addPageInitMessage({
type: message.Type.INFORMATION,
message: ‘Customer has a Outstanding Balance of amount ‘ + outstandingBalance,
title: ‘Outstanding Balance’,
duration: 7000, // Optional: Show for 7 seconds
});
