function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vineet GogiaVineet Gogia 

Getting Organization ID

Hi,

Is there a way to get the Organization ID of the Users (ID of the organization to which the users belong)? What kind of a permission would be needed to get this information? Also I went through the SForce API 2.0 and specifically through the ERD's but could not locate an entity by the name of Organization. Is there a different name for it or something that I'm missing?


Regards,
Vineet Gogia
Theikos.
DevAngelDevAngel

Hi Vineet,

DevAngel Wrote: You cannot obtain the org id through the api at this time.

This is an error.  My face is red.  There is actually an undocumented method in the WSDL ( and is available via xml-rpc also) called get_user_info.  This method takes no parameters and returns various information about the currently logged in user.  Included in this is the org id.

My humble apologies.

Message Edited by DevAngel on 07-11-2003 11:49 AM

Vineet GogiaVineet Gogia
Hi Dave,

What I actually need is to co-relate two different Salesforce User Id's if they belong to the same Organization.

The application we're building is directly enabled for existing Salesforce users and the user ID's/Passwords are authenticated using the API. So for example if two users of the salesforce (and of the same organization in salesforce) access our application they should have access to the same set of data (our app data). There's a property "Company name" in the "User" Entity but the company name can potentially change over time.

Any suggestions for a workaround?

Thanks & Regards,
Vineet Gogia
Theikos
DevAngelDevAngel

Hi Vineet,

Useful information can be found here.

Vineet GogiaVineet Gogia
Many thanks!

There's yet another call (as per ver 1.7 document) get_org_info, is that still available?

Thanks Again,
Vineet
DevAngelDevAngel

Hi Vineet,

Yup, still available, unchanged.

solliviersollivier

I was looking for some kind of organization ID in Sforce API 2.5 to solve a problem similar to the one discussed in this thread.  Looking for an ID that coresponds to the SF account, under which to gather info pertinent to all users of the account.

getUserInfo does not return an Org ID, but only an Org Name, which may change over time.  Any suggestions?

DevAngelDevAngel

Hi solliver,

There is no documented way that I know of to obtain the org id.  We are toying with the idea of providing a richer return from the login that might include the info from the getUserInfo as well the org id.  We have a couple options of how to return the information you seek.  One is to add another call like getUserInfo called getOrgInfo.  Since neither of these calls requires any parameters, the option of including this information on the LoginResult is also available.  So the login result structure would have an userInfo object and an orgInfo object.

Which option would suit  your needs best?

SergeantAgniSergeantAgni

Either solution you mention would work.  Actually, it even makes some sence to both return this informaiton with login and provide getOrgInfo and/or getUserInfo calls.  Returning with login means no extra round trip when this information is always needed.  Having an explicit call means I can ask for it when and if I need it, rather than having to retrieve and store it in case I may need it later.

Also, I have no problem with putting the Org info in with getUserInfo and just having one call.

Were it my decision and I had no addition issues, I'd just extend getUserInfo and leave it at that.

[Scott and I work together and I accidentally used his handle when asking this question last week. ]

--Brad

HaroldHHaroldH
With the impending Spring 2004 release of the Sforce API, are there any plans to include an easy way to retrieve the OrganizationId for the currently logged-in user?

Would an alternative approach be to simply retrieve the ID from the one (and presumably only) record in the Organization table?
adamgadamg
There are no changes in sforce 3.0 that will make this different - getting the id from the org object seems very reasonable.
HaroldHHaroldH

Sounds good. 

Is it safe to assume that in all cases, the Organization object will only contain a single record?