Working with Messages
See also:
Working with Presentation
Templates
A message
is a language dependent text which can be sent to the user programmatically
when certain conditions arise. The script command to send a message is either :
message type, messagenumber [,parm1, parm2,
parm3 ......] (this is a standard format message)
or simply...
message 'text'
(this is a simple
format message)
The type can
be set as:
E error message
W warning message
F information message to be displayed on
the final page
error messages are the most common type and
will result in an error message being displayed immediately above the field
where the error was detected or at the bottom of the page if the message is
issued from a page event . When a script issues an error message, form
processing stops immediately and the page is re-displayed to the user with the
error message. The user must correct the error to proceed. The foreground and
background colours can be changed to ensure the messages are clearly displayed.
warning messages are similar to error messages
except that form processing will not stop. Warning messages must be acknowledged
by the user by confirming the message. As with error messages, the
foreground and background colours can be changed.
final page messages will be displayed on the
Ebase final page that is displayed after form processing has completed. They normally
contain information about what the form has done and feedback information on
numbers of records created, e.g. order numbers, etc.
The simple
syntax displays an error message to the end user. This syntax does not
provide support for multiple languages, substitution of form field variables
into the message, or warning or final messages.
Note:
Error and warning messages can only be issued by FPL scripts associated with
after-field or after-page events.
All three
types of message allow form field values to be substituted into the message
text. For example, if message 1234 contains text :
"You cannot order && with &&"
and a script contains command :
message E, 1234, EXTRA_ORDER_ITEM1, MAIN_ORDER_ITEM;
then the user may get a message saying :
"You cannot order ketchup with caviar"
Messages are created and maintained using the message
editor. Numbering of messages is performed automatically by the system and each
Ebase project will have its own set of messages. A message can only be issued
by a script within the same project. The message editor is opened by clicking
once on Messages under the project name in the hierarchy tree panel.

In the language selection you can select all the languages
which you wish to maintain (hold the CTRL key to select multiple languages).
Then press the REFRESH key.
Messages
can be added or deleted using the toolbar or by right-clicking in the messages
table area.
The message
text can contain any text that you require. You can expand the text entry area
by right-clicking over it or by double-clicking in the number or language
columns for the appropriate row of the table. To substitute a
form field dynamically at runtime into the message text, enter && into
the message text. You can have up to 10 such substitutable parameters
within each message. See the message FPL script command above for an example of
how to specify the form fields to be used for the substitution.
To save the
messages, click Save
Error and
warning messages issued from an after-field event are displayed immediately
above the field in error, i.e. the field associated with the FPL command script
that issued the message. The focus will be transferred to this field. Error and
warning messages issued from an after-page event are displayed at the bottom of
the page and the page is scrolled to make the message(s) visible.
Final page
messages can be issued at any time during form processing. They are accumulated
and displayed on the form's final page.
The
presentation attributes font, size, colours, etc. used to display all messages
can be specified in the presentation template associated with the form. The
attributes of each message type can be specified separately. (See Working with Presentation
Templates for more information)
Global
messages created in the GLOBAL project are accessible by all forms. They
are referenced in exactly the same way as for any other message (as described
above) except that they begin their numbering from 100,000 as opposed to 1,000
for messages in all other projects.
Global
messages are also used with components (See Working with Components for more
information).