Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to developing an alert on entity

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)!”

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to developing an alert on entity

    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});
    }

  • AvihayM6 Profile Picture
    AvihayM6 5 on at
    RE: How to developing an alert on entity

    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
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: How to developing an alert on entity

    Hi, 

    You need to use setformnotification function.

    Please refer to this blog for more details: 

    itsfascinating.com/.../

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans