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

Announcements

News and Announcements icon
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 81 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");
    }
}

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • Allie_B Profile Picture
    81 User Group Leader on at

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
KristineRisberg Profile Picture

KristineRisberg 37

#2
11manish Profile Picture

11manish 35

#3
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 21 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans