Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

Posted on by 1,329

Hi Folks,

We have few Custom HTML Webresources which were standalone and not called from any form or a ribbon. ClientGlobalContext.js.aspx is used to get context information previously. 

But understood that this would be deprecated on Dec 1, 2020. Is there any alternative for this in UCI? Also please let us know if there was any other way to replace addonkeypress event without using any custom control.

Thank you.

Pavan Mani Deep 

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

    An important update on ClientGlobalContext.js.aspx's deprecation and removal timeline:

    The ClientGlobalContext.js.aspx page is deprecated and scheduled to be unavailable after October 1, 2021.
    Alternative methods to access global context information will be available before April 1, 2021

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx

  • Zach G Profile Picture
    Zach G 15 on at
    RE: Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

    Andrii,

    How would you have access to the WebAPI without ClientGlobalContext.js.aspx?  Just to get the URL to CRM, you need to call Xrm.Utility.getGlobalContext().

    How do we get around this?

    Thanks,

    -Z

  • pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

    Thank you Andrew & Henry...for your suggestions...

  • Verified answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

    Hi Pavan,

    On top of Andrew's advise, please refer to this page on ClientGlobalContext.js.aspx deprecation:
    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx

    Henry

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Alternatives to ClientGlobalContext.js.aspx & addOnKeyPress in Unified interface

    Pavan,

    What information do you use from the context? Pretty much everything can be received either from the Url or queries using WebApi.

    Unfortunately there is no direct replacement for addOnKeyPress. You will have to use Custom PCF control. I created it already so you can tru it - github.com/.../Text-Autocomplete-Control

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