Jeff
Jeff

Reputation: 36583

Dynamics CRM Get Current Organization Name

I need to get the current organization name inside of an aspx page in the ISV directory. The only example I've seen of this tries to parse it out of the URL or the domain name, but the URL doesn't have the current org name because the page is in the ISV directory...and the domain name doesn't have it period in my case.

How can I get the org name?

I need this so that I can call CrmAuthenticationToken.ExtractCrmAuthenticationToken.

Thanks.

Upvotes: 1

Views: 2306

Answers (2)

Troydm
Troydm

Reputation: 2680

If you have access to SQL Server database of CRM you can execute following select:

SELECT [UniqueName] FROM [MSCRM_CONFIG].[dbo].[Organization]

Upvotes: 0

TeaDrivenDev
TeaDrivenDev

Reputation: 6629

There is no "current" organization in an ASP.NET page as long as you do not have an initialized CrmService. You will of course want it to be the organization that is being used within the browser instance from which the page was called, but that will have to be passed in the page's QueryString from which you can get it via Request.QueryString["orgname"] (or whatever you call the QueryString parameter).

Upvotes: 1

Related Questions