EndMessage function

Syntax

EndMessage(message, messagebox_title)

Description

Note:

The EndMessage function is obsolete and is supported only for backward compatibility. The MessageBox function, which can now be used to display informational messages in any PeopleCode event, should be used instead.

Use the EndMessage function to display a message at the end of a transaction, at the time of the database COMMIT. This function can be used only in SavePostChange PeopleCode.

When an EndMessage function executes, PeopleTools:

  • Verifies that the function is in SavePostChange; if it is not, an error occurs and the function terminates.

  • Displays the message.

  • Terminates the SavePostChange PeopleCode program.

Because it terminates the SavePostChange program, EndMessage is always be the last statement executed in the program on the specific field and row where the EndMessage is called. For this reason, you must write the SavePostChange program so that all necessary processing takes place before the EndMessage statement. PeopleCode programs on other fields and rows execute as usual.

Parameters

Parameter Description

message

A string that must be enclosed in quotes containing the message text you want displayed.

messagebox_title

A string that must be enclosed in quotes containing the title of the message. It appears in the message box title bar.

Returns

None.

Example

The following example is from SavePostChange event PeopleCode. It checks to see whether a condition is true, and if so, it displays a message and terminates the SavePostChange program. If the condition is false, then processing continues in the Else clause:

If BUSINESS_UNIT = BUS_UNIT_WRK.DEFAULT_SETID Then
         EndMessage(MsgGet(20000, 12, "Message not found in Message Catalog")," ");
      Else
/* any other SavePostChange processing in Else clause */