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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Instance type is sandbox or production in your JavaScript code

(0) ShareShare
ReportReport
Posted on by 1,738

Hi Experts,

How we will find that the working instance is Production or Sandbox using javascipt code? I want to get value of Instance Type(Production / Sandbox) So that I would display on my custom form.

I have the same question (0)
  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Unfortunately we could not get the instance type from javascript code.

    We could get it by Online Management Api with C#.

    We could use "{ServiceUrl}/api/v1.2/Instance/{id}" to get a instance's details. The instance id could be found in Settings->Customizations->Developer Resource.

    pastedimage1574912184666v1.png

    And this doc provided a sample about how to get the instances by C#, but I tried the sample code and the feature "AuthenticationParameters.CreateFromResourceUrlAsync" it used is now obsolete so that we should find another way instead to test. Microsoft haven't update the code yet :-(

    pastedimage1574912384040v2.png

    You could also refer to the following docs.

    https://docs.microsoft.com/en-us/rest/api/admin.services.crm.dynamics.com/instances

    https://docs.microsoft.com/en-us/rest/api/admin.services.crm.dynamics.com/instances/getinstance

    https://docs.microsoft.com/en-us/rest/api/admin.services.crm.dynamics.com/instances/getinstances

    Hope it helps.

    Best Regards,

    Leo

  • ajyendra Profile Picture
    1,738 on at

    Hi Leo,

    Thanks for response

    As I hit that url in my browser

    admin.services.crm.dynamics.com/.../

    It gave me error of access denied as mention below:

    Access to admin.services.crm.dynamics.com was deniedYou don't have authorization to view this page.

    My region is North America

    I have both Global administrator and system administrator permission.

    Can you know Why this happen?

    What type of additional permission we need?

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 104 Super User 2025 Season 2

#2
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 30

#3
MikeC - RAMCO Profile Picture

MikeC - RAMCO 21

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans