setNotification (Client API reference)
Displays an error message for the control to indicate that data isn't valid. When this method is used, a red "X" icon appears next to the control. On Dynamics 365 mobile clients, tapping on the icon will display the message.
Note
Always make sure that the control you are using setNotification
with is visible on the form.
setNotification
will not return an error if you use it on a control that is visible but is within a section or tab that isn't visible. When saving a record setNotification
will display a message at the top of the form as a validation error. If the control is not visible because it is within a hidden parent section or tab, the user cannot fix this.
Control types supported
Standard, lookup, choices and choice control types.
Syntax
formContext.getControl(arg).setNotification(message,uniqueId);
Parameters
Name | Type | Required | Description |
---|---|---|---|
message |
String | Yes | The message to display. |
uniqueId |
String | No | The ID to use to clear this message when using the clearNotification method. |
Return Value
Type: Boolean
Description: Indicates whether the method succeeded.
Remarks
Setting an error notification on a control will block the form from saving.
Related articles
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈