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)

How to know CRM account detail whether it is on premise or online using HTML/js resource?

(0) ShareShare
ReportReport
Posted on by

Hi,

I am working on a solution where I need to change code flow according to the CRM Account Type(On Premise/Online).

Can anybody suggest me how can I come to know whether account is OnPremise or Online using WebAPI(Ajax) call?

Please guide

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    I don't think you need webapi for that.

    You can just get the Client Url using Xrm.Page.context.getClientUrl()

    If that client Url has dynamics.com in the Url, you know that it's the online environment.

    Hope this helps

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Chhaya,

    Below blog from Syed might help :

    http://mscrm365.blogspot.in/2017/12/how-to-check-crm-instance-is-online-or.html 

    mark this suggestion as verified if helpful

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Just to add to Rawish's comment, the context.isOnPremise is only available for CRM version 9 and above.

    If you have version 9 (July 2017 update), that is the way to go.

    If you are still on 8.2 or previous version the getClientUrl is probably the easiest way to get you the results that you are looking for.

    Hope this helps.

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Chhaya,

    this code is valid for all versions:

    var clienturl = Xrm.Page.context.getClientUrl();
    var iscloud = clienturl.indexOf("dynamics.com") > -1;
    if(iscloud)
    ...
    else
    ...

    Please let me know if you solve.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

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