Editar

Compartilhar via


ErrorInfo.Message([Text]) Method

Version: Available or changed with runtime version 3.0.

Specifies the message that will be sent to telemetry. For a 'Client' error type, the message will also be appear in the client.

Syntax

[Message := ]  ErrorInfo.Message([Message: Text])

Note

This method can be invoked using property access syntax.

Parameters

ErrorInfo
 Type: ErrorInfo
An instance of the ErrorInfo data type.

[Optional] Message
 Type: Text
The message of the ErrorInfo

Return Value

[Optional] Message
 Type: Text
The current message of the ErrorInfo.

Remarks

Set the Message property on error dialogs that are presented to the user. For advice on how to use the title to describe what’s wrong and enable the user to quickly scan the meaning of the error, see User experience guidelines for errors.

Setting the Message property on error dialogs is required. For more information on how to express error messages, see Error message best practices - what to say?.

Example

var 
    dimension: Text[30];
    vendorCode: Text[30];
    MyErrorInfo: ErrorInfo;
begin
    // set up the error info object
    MyErrorInfo.Message(
        StrSubstNo('The dimension value must be blank for the dimension %1 for Vendor %2', dimension, vendorCode)
    );
    MyErrorInfo.DetailedMessage('Add some text to help the person troubleshooting this error.');
    // maybe set more properties

    Error(MyErrorInfo);
end

ErrorInfo Data Type
User experience guidelines for errors
AL error handling
Get Started with AL
Developing Extensions