web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: How to make alert/warning appear on form?

    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,983 Moderator on at
    RE: How to make alert/warning appear on form?

    Hi,

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

    itsfascinating.com/.../

  • Tamilarasu Arunachalam Profile Picture
    587 on at
    RE: How to make alert/warning appear on form?

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 178

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 142 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans