Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Is there a way to use JS code to determine the form context is from "Hub"(Unified Interface--Sales Hub/Customer Service Hub) or just the regular form.

Posted on by 240

Hi All,

Microsoft introduced Sales Hub & Customer Service Hub (Unified Interface) since 2016, which provide fantastic user experience,

However, if a form has too much legacy code on the form,  it may be not working correctly in the hub mode.

So I am wondering if we can use the JS code to determine the current form context is from Hub or regular form.

In D365 V9,

We can actually use the following code to determine current form context, for example:

Xrm.Utility.getGlobalContext().client.getClient()      ----returning "Web", "Outlook", "Mobile"

Xrm.Utility.getGlobalContext().client.getClientState()  ----returning  "Online"/"On-premise"

But I can not find anything to determine if it is from "Hub"(Unified Interface) or regular form.

Anyone has the similar idea or experience, please tell me know how to do.

Thank you.

Regards

Harry

*This post is locked for comments

  • HarryZang Profile Picture
    HarryZang 240 on at
    RE: Is there a way to use JS code to determine the form context is from "Hub"(Unified Interface--Sales Hub/Customer Service Hub) or just the regular form.

    Thank you so much for your reply , Ravi

    According to your reference and the following link, we can use

    Xrm.Internal.isUci() to determine if it is from unified interface or not

    community.dynamics.com/.../dynamics-365-detect-unified-interface-from-javascript

    github.com/.../155

    Although it is a little bit unsupported, it at least resolved my issue now.

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Is there a way to use JS code to determine the form context is from "Hub"(Unified Interface--Sales Hub/Customer Service Hub) or just the regular form.

    Hi Harry,

    Currently  is not possible to identify if it is Web or unified interface and I guess this is because all the XRM methods are supposed to work on both web & unified interface. This issue has been already raised in the document - github.com/.../issues;q=%22a470f3bb-2857-f0ba-d085-0a0497e90ca3%22&in=body

    You can also open an idea on this so that we get some new option to identify it correctly- experience.dynamics.com/ideas

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans