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 :
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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans