You need to sign in to do that
Don't have an account?

java code to list all the objects in salesforce
I want a list all the objects present in my salesforce application in a java application after i login into SFDC from a java api.
can someone please help me
Thanks!
Hi,
Try the below code snippet as reference:
public class allSFDCObjects
{
static final String USERNAME = "username";
static final String PASSWORD = "password+sectoken";
static EnterpriseConnection connection;
public static ConnectorConfig config = new ConnectorConfig();
public static void main(String[] args)
{
getAllSFDCObjects();
}
public static void getAllSFDCObjects()
{
try
{
config.setUsername(USERNAME);
config.setPassword(PASSWORD);
connection = Connector.newConnection(config);
DescribeGlobalResult res = connection.describeGlobal();
System.out.println("Objects::"+res.toString());
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("Exception:: " + e.getMessage());
}
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hi,
can you give sample code on how to get list of all fields of an SObject in Java.