web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to make alert/warning appear on form?

(0) ShareShare
ReportReport
Posted on by 10

Hi all, 

Hope this is the correct place to post this. 

I need to get a message alert on a form when a certain field equals yes. This field is a yes/no field with values 0 and 1. 

So basically when the field is set to yes then the message needs to appear for the user. 

I have tried implementing some Javascript onto the field properties as an OnChange event but this does not seem to work. Here is the JS I used - 

function WarningMessage() {

if ($("#ggh_potentialconflict").attr() == "1" {
alert("The Account has a potential problem!");
}

}

Is there a way I can do this without Javascript? Otherwise please let me know if I might be doing something wrong. 

Thank you for any help. 

I have the same question (0)
  • Ray Profile Picture
    1,537 on at

    Business Rule can Validate data and show error messages not sure if this can solve your requirement.

    If you want to do it with Javascript, I think you should follow Xrm object model design. It is an unsupport way to access Dom directly. There is an openAlertDialog function to show alert.

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    You should be using SetFormNotification in CRM Dynamics to show warnings on the form.

    itsfascinating.com/.../

  • Tamilarasu Arunachalam Profile Picture
    593 on at

    for notification

    formContext.ui.setFormNotification("Text to notify","WARNING","id");

    for alert
    Xrm.Utility.alertDialog("message", null);

    Regards,

    Tamilarasu Arunachalam

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 123

#2
Hamza H Profile Picture

Hamza H 112 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans