DexGetmsg()

The DexGetmsg() function returns a message string that is stored in the application dictionary.

Syntax

getmsg(message_ID)

Parameters

message_ID - An integer containing the message ID of the message you want to retrieve.

Comments

Message strings are often used for messages displayed to the user.

Return value

String

Examples

The following C# example shows how a message string is retrieved and displayed to the user if the checkbook ID supplied is not valid. The message with message ID 397 says, "The checkbook doesn't exist."

TableError err;
string message;

CmCheckbookMstrTable CheckbookMasterTable;
CheckbookMasterTable = Dynamics.Tables.CmCheckbookMstr;

// Set the key value
CheckbookMasterTable.CheckbookId.Value = textBoxID.Text;

// Set the key to use
CheckbookMasterTable.Key = 1;

// Try to retrieve the record
err = CheckbookMasterTable.Get();

if (err == TableError.NotFound)
{
    // Could not find checkbook
    message = Dynamics.Forms.SyVisualStudioHelper.Functions.DexGetmsg.
    Invoke(397);

    Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.
    Invoke(message);
}

if (err == TableError.NoError)
{
    textBoxDescription.Text = CheckbookMasterTable.Description.Value;
}

// Close the table
CheckbookMasterTable.Close();

The following Visual Basic example shows how a message string is retrieved and displayed to the user if the checkbook ID supplied is not valid. The message with message ID 397 says, "The checkbook doesn't exist."

Dim err As TableError
Dim message As String

Dim CheckbookMasterTable As CmCheckbookMstrTable
CheckbookMasterTable = Dynamics.Tables.CmCheckbookMstr

'Set the key value
CheckbookMasterTable.CheckbookId.Value = TextBoxID.Text

'Set the key to use
CheckbookMasterTable.Key = 1;

'Try to retrieve the record
err = CheckbookMasterTable.Get()

If err = TableError.NotFound Then
    'Could not find checkbook
    message = Dynamics.Forms.SyVisualStudioHelper.Functions.DexGetmsg _
    .Invoke(397)
    Dynamics.Forms.SyVisualStudioHelper.Functions.DexError _
    .Invoke(message)
End If

If err = TableError.NoError Then
    textBoxDescription.Text = CheckbookMasterTable.Description.Value
End If

'Close the table
CheckbookMasterTable.Close()