Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

How to make alert/warning appear on form?

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,962 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/.../

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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans