Specifies your organization ID so that you can authenticate Self-Service users for your organization using the existing login().
Starting with Spring ’12, the Self-Service portal isn’t available for new Salesforce orgs. Existing orgs continue to have access to the Self-Service portal.
Note
API Calls
login()
Fields
organizationId
Type: ID
Description: The ID of the organization against which you authenticate Self-Service users.
portalId
Type: ID
Description: Specify only if user is a Customer Portal user. The ID of the portal for this organization. The ID is available in the Salesforce user interface: Values include From Setup, enter Customer Portal Settings in the Quick Find box, then select Customer Portal Settings, or Select a Customer Portal name, and on the Customer Portal detail page, the URL of the Customer Portal displays. The Portal ID is in the URL..
Sample Code—C#
This sample shows how to use the LoginScopeHeader. It sets the organization ID and the portal ID for a Customer Portal user. It also sets the CallOptions header. It then logs the specified user in.
1/// Demonstrates how to set the LoginScopeHeader values.2public void LoginScopeHeaderSample()3{4 // Web Reference to the imported Partner WSDL.5 APISamples.partner.SforceService partnerBinding;67 string username = "USERNAME";8 string password = "PASSWORD";910 // The real Client ID will be an API Token provided by Salesforce11 // to partner applications following a security review. For more details,12 // see the Security Review FAQ in the online help.13 string clientId = "SampleCaseSensitiveToken/100";1415 partnerBinding = new SforceService();16 partnerBinding.CallOptionsValue = new CallOptions();17 partnerBinding.CallOptionsValue.client = clientId;1819 // To authenticate Self-Service users, we need to set the OrganizationId20 // in the LoginScopeHeader.21 string orgId = "00ID0000OrgFoo";22 partnerBinding.LoginScopeHeaderValue = new LoginScopeHeader();23 partnerBinding.LoginScopeHeaderValue.organizationId = orgId;24 // Specify the Portal ID if the user is a Customer Portal user.25 string portalId = "00ID0000FooPtl";26 partnerBinding.LoginScopeHeaderValue.portalId = portalId;2728 try29 {30 APISamples.partner.LoginResult lr =31 partnerBinding.login(username, password);32 }33 catch (SoapException e)34 {35 Console.WriteLine(e.Code);36 Console.WriteLine(e.Message);37 }38}