package com.thysmichels;
import java.io.IOException;
import com.sforce.soap.partner.*;
import com.sforce.ws.*;
public class SalesforceGlobalSearch {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ConnectorConfig sfconfig = new ConnectorConfig();
//Use your salesforce username = email
sfconfig.setUsername("username");
//Use your saleforce password with your security token look like: passwordjeIzBAQKkR6FBW8bw5HbVkkkk
sfconfig.setPassword("passwordsecuritytoken");
PartnerConnection partnercon = null;
try {
partnercon = Connector.newConnection(sfconfig);
DescribeGlobalResult describeGlobalResult =
partnercon.describeGlobal();
if (describeGlobalResult != null)
{
Object[] obj = describeGlobalResult.getSobjects();
if (obj != null)
for (int i = 0; i < obj.length; i++)
{
System.out.println("SObjects: " +'\n' + obj[i]);
}
}
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
}
Output
SObjects: [DescribeGlobalSObjectResult activateable='false' createable='true' custom='false' customSetting='false' deletable='true' deprecatedAndHidden='false' feedEnabled='true' keyPrefix='001' label='Account' labelPlural='Accounts' layoutable='true' mergeable='true' name='Account' queryable='true' replicateable='true' retrieveable='true' searchable='true' triggerable='true' undeletable='true' updateable='true' ]