Displaying Alerts to the User
A few other message types you can use are for displaying different message type alerts to the user.
Sage.UI.Dialogs.alert('This is a message', 'The Title');
This looks like this:
There are also the following alert functions which are also mean to display an icon for the alert based on the type, however in current versions of Infor CRM, the CSS hides the icon, so these will all look the same:
// info alert Sage.UI.Dialogs.showInfo('This is an info message', 'Info Title'); // warning alert Sage.UI.Dialogs.showWarning('This is a warning message', 'Warning Title'); // error alert Sage.UI.Dialogs.showError('This is an error message', 'Error Title');
To display this same alert from server-side code, you can use the following
throw new Sage.Platform.Application.ValidationException("This is an error message");
Technically, this throws the exception, which is caught and the client-side alert is displayed as above.