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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Detect if CRM page is hosted in USD via javascript

(0) ShareShare
ReportReport
Posted on by 517

Does anyone know if, via javascript, I can detect whether the crm page is hosted in a browser or in Unified Service Desk?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Brad Sprigg Profile Picture
    985 on at

    Hi Kyle

    I looked into this a few months ago, below is how I managed to do so.

    community.dynamics.com/.../193827

    Having said that, I just noticed this article by Niel Parkhurst about using window.IsUSD but I haven't tried that method.

    community.dynamics.com/.../usd-window-isusd

    Regards

    Brad

  • kyleknab Profile Picture
    517 on at

    Hi Brad,

    Thanks for the links.  I just gave Niel's script a test and it works.  I was skeptical at first, because searching for the window's "IsUSD" value via a browser console is fruitless; it's undefined when you're not in USD.  But when rendering a CRM form in USD, indeed

    window.IsUSD = true

    For anyone coming across this post, here is Niel's simple function:

    function onLoad() {
     if(window.IsUSD == true) {
      alert("This form is being loaded in USD!");
     } 
    else { alert("This form is being loaded NOT in USD!"); } }


  • Community Member Profile Picture
    on at

    Hi Kyle,

    I am also trying to run this script in my webresource to detect whether the hosted control is hosted in browser or in USD, but everytime i am getting the wrong result means undefined value.

    Please suggest some idea to resolve the issue.

  • kyleknab Profile Picture
    517 on at

    I think the version of the USD solution and the USD client you're using both come into play. I've had this not work in the past, on older versions of both the solution and client. Maybe consider upgrading either your solutions or client version.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans