Skip to main content

Notifications

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. 

  • 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

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 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/.../

  • Ray Profile Picture
    Ray 1,505 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.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans