RAD function: scmsg

Returns a text string matching the format of the message ID number and message class specified. The function replaces any variables in the message with the text specified in an array of values.

Function

scmsg

Format

scmsg($id, $class, $arrayof values)

Parameters

The following parameters are valid for the scmsg function:

Parameter Data type Description
$id Number The ID number of the message (message.id) from the scmessage table.
$class String The Message class from the scmessage table.
$arrayofvalues Array An array of substitution text for the %S variables in the message text from the scmessage table.

Factors

  • All substitution text must be %S, which indicates that a string is used to provide the data. Each entry in the array of substitution text is examined for the type. If it is not a string type, it is converted to a string.
  • You must create a separate record in the scmessage table for the message in each language you want to display.
  • The $arrayofvalues defined in the scmsg function are applied to the message in the scmessage table corresponding to the language defined for the client login.
  • When adding a scmessage record to the scbutton class, the scballoon class, the sccaption class, and the sctitle class, the message ID must end with _<number>. <number> is a string of decimal positions of the uppercase characters in the message ID. For example, My Affected Example_1413. In this example, 1413 symbolizes the positions of the uppercase characters of M (1), A (4), and E (13) in the message ID, respectively.

  • When calling the scmsg() function, the message ID must be used without the _<number> suffix.

Example

scmsg("21", "cib", {"mail", "middle,caller.id", "open"})

Resulting message from the scmessage table:

Built macro to %S to %S on %S.

When the %S array values from the scmsg function in the example are applied, the message is displayed as:

Built macro to mail to middle,caller.id on open