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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to developing an alert on entity

(0) ShareShare
ReportReport
Posted on by 5

Hey guys,

I'm tried a few days to get solutions for my mission without success.

I need to develop an alert message without using Alert built in method on JavaScript.

It should be on Account entity when open a form.

The mission included.

Anyone know how to start it? Good tutorials are welcome!

Thanks a lot.

The mission:

On this task you have to add a JavaScript to the “Account” entity form so it will welcome you when you enter the account – On the OnLoad event of the page, show a form notification (not JavaScript alert) message with the text : “ Welcome <Name>!” Instead of the <Name> you should insert the name as it appears in the Account Name (schema name = name) of the account. For example: if the account name is “Adventure Works (sample)”, on entering the account the user will see a message “ Welcome Adventure Works (sample)!”

I have the same question (0)
  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi, 

    You need to use setformnotification function.

    Please refer to this blog for more details: 

    itsfascinating.com/.../

  • AvihayM6 Profile Picture
    5 on at

    Hey,

    It׳s OK, but I need the beginning steps from the Form properties till the publish.

    and how I can check that.

    Thanks

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    Please follow the steps;

    1. Navigate to the Data->Tables->Account->Form->Account(for example), click the form and add form library.

    Addlibrary.png

    2. New a Web Resource and add it to your form libraries.

    5265.newwebresource.png

    pastedimage1628489281206v1.png

    pastedimage1628489298931v2.png

    3. Create a on load event and use that library.

    pastedimage1628489369773v3.png

    4. Save and publish the form. Then open the Sales Hub app and click one Account row, you will see the message.

    pastedimage1628489489592v4.png

    Sample JS:

    function formOnLoad(executionContext){
        var formContext = executionContext.getFormContext();
        var name = formContext.getAttribute("name").getValue();
        var message = "Welcome " + name + " !";
        Xrm.Navigation.openAlertDialog({ text: message});
    }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 58 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 42

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans