Scripting alert, info, and error messages

You can send messages to customers as alerts, informative messages, or error messages.

Table 1. Business rule and other general use scripts
Script Result
current.field_name.setError("Hello World"); Will put "Hello World" below the specified field.
gs.addInfoMessage("Hello World"); Will put "Hello World" on the top of the screen.
gs.print("Hello World"); Will write to the text log on the file system but not to the sys_log table in the database.
gs.log("Hello World"); Will write to the database and the log file.
Note: Too much of this can adversely affect performance.
Important: The methods in this table are only for use with client scripts.
Table 2. Client side scripts
Script Result
alert("Hello World"); Will pop up a window with "Hello World" and an 'OK' button.
confirm("Hello World"); Will pop up a window with "Hello World?" and a 'Ok' and 'Cancel' buttons.
g_form.showFieldMsg("field_name", "Hello World", "error"); Puts "Hello World" in an error message below the specified field.
g_form.hideFieldMsg("field_name"); Hides an error box that is visible under the specified field.
It is also possible to add other custom messages to your forms if necessary using client scripting.

The text size of info and error messages at the top of the screen is customizable. Two properties control this. If you configured your forms, you may need to add these properties.

Table 3. Error and alert text size properties
Property Description
css.outputmsg.info.text.font-size Sets the size for info messages. Default is 11pt.
css.outputmsg.error.text.font-size Sets the size for error messages. Default is 11pt.