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 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應