Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Deprecated Api - Replacement for Notification Banner script

(0) ShareShare
ReportReport
Posted on by 74 User Group Leader

Dynamics CRM 8 and earlier supported Api Xrm.Page which you could use in a script to set alert banners at the top of a page/form in the UI.

I want to update my custom scripts that use Xrm.Page.getAttribute andxrm.page.ui.setformnotification Xrm.Page.ui.setFormNotification since Xrm.Page has been deprecated in Dynamics 365 9.

I know I need to use formContext.ui.setFormNotification instead of xrm.page.ui.setformnotification. What do I use to replace Xrm.Page.getAttribute?
Thanks!

example script to be updated:

function CustSvcManaged() {

    var CustSvcManaged = Xrm.Page.getAttribute("et_custsvcmgd").getValue()

    if (CustSvcManaged == '1') {

        Xrm.Page.ui.setFormNotification("This customer is managed by the Customer Service group", "INFORMATION");
    }
}

  • Allie_B Profile Picture
    74 User Group Leader on at
    RE: Deprecated Api - Replacement for Notification Banner script

    Thanks so much, Ravi! That's what I was looking for! :)

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Deprecated Api - Replacement for Notification Banner script

    Hi,

    You need to use formcontext. Refer below-

    docs.microsoft.com/.../clientapi-form-context

    Do remember to pass the context when you register the event in crm. Refer below for more details-

    carldesouza.com/.../

    Here is what it will looks like-

    =====================================

    function CustSvcManaged(executionContext) {

       var formContext = executionContext.getFormContext();

       var CustSvcManaged = formContext.getAttribute("et_custsvcmgd").getValue();

       if (CustSvcManaged == '1') {

           formContext.ui.setFormNotification("This customer is managed by the Customer Service group", "INFORMATION");

       }

    }

    ======================

    Hope this helps.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans