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
SergeantAgniSergeantAgni 

Starting from a WIL, Need to identify Users' SF account

In this message I'm using SF Account to mean the SFDC user account, not the Sforce Account object.  Don't know how else to phrase this, though it is confusing.

I'm building a composite application that is triggered via a SFDC Web Integration Link (WIL) and runs in the SFDC UI frame.  Multiple users from different SF accounts will use this composite application.  I need to be able to reliably identify/distinguish the account of the current user in order to organize and store info that is common to all users of that account.  I can find no way of doing this using the WIL or the SF API (version 2.5).  I must be missing something as the inability to do this is a show stopper for many types of applications.  Others must have figured this out.  What am I missing?

Note: the Organization Name available from the WIL can be changed by the user and so is not a reliable identifier.  If there were an Organization ID that was unique across all SF accounts (organizations?) and available via the WIL then the problem would be solved.

Suggestions?

--Brad

DevAngelDevAngel

Hi SergeantAgni,

In our next release the org id will be available as a merge field on the Organization Fields field type as well as from the API.  I'm not sure if in the API it will be on the login result or get user info result.

In the mean time, you can use the API 2.0 call get_user_info().  This will contain the organization id, which is immutable for an org.

The get_user_info() is an undocumented call in API 2.0, and is not the most elegant solution, but will provide what you need.

Attached is the doc for API 2.0.

Cheers.

SergeantAgniSergeantAgni

Thanks for the info.  Can you give me a general idea when this release will be?

In the mean time, currently the WIL provides the session id and server URL for use with Sforce API version 2.5.   Can the session ID also be used to login specifying version 2.0 of the API (and using the version 2.0 wsdl and stubs, etc. of course)?  Assuming the answer is yes, wouldn't this require a different server URL?  That new URL would have to be constructed by hand, perhaps based on the one provided?  That is:

https://na1-api.salesforce.com/services/Soap/u/2.5  must be converted to ???   What?

--Brad

 

DevAngelDevAngel

Hi SergeantAgni,

The next release is scheduled for spring, that's as specific as I can get. 

The session id can be used by the other API, and yes, you will have to parse the server url.  The 2.0 url is https://www.salesforce.com/servlet/servlet.SoapApi for the login (which you don't need), and the instance url is https://na1.salesforce.com/servlet/servlet.SoapApi for other calls.  Do not use na1-api, just na1.  Of course, this assumes that na1-api was returned on the wil.

Cheers

SergeantAgniSergeantAgni
Thanks, that makes it clear.