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

import?
private void describeSObjectsSample()
{
try {
DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
for (int x=0;x<describeSObjectResults.length;x++)
{
DescribeSObjectResult describeSObjectResult = describeSObjectResults[x];
// Retrieve fields from the results
Field[] fields = describeSObjectResult.getFields();
// Get the name of the object
String objectName = describeSObjectResult.getName();
// Get some flags
boolean isActivateable = describeSObjectResult.isActivateable();
System.out.println("Object name: " + objectName);
// Many other values are accessible
if (fields != null)
{
// Iterate through the fields to get properties for each field
for (int i = 0; i < fields.length; i++)
{
Field field = fields[i];
int byteLength = field.getByteLength();
int digits = field.getDigits();
String label = field.getLabel();
int length = field.getLength();
String name = field.getName();
PicklistEntry[] picklistValues = field.getPicklistValues();
int precision = field.getPrecision();
String[] referenceTos = field.getReferenceTo();
int scale = field.getScale();
FieldType fieldType = field.getType();
boolean fieldIsCreateable = field.isCreateable();
System.out.println("Field name: " + name);
// Determine whether there are picklist values
if (picklistValues != null && picklistValues[0] != null)
{
System.out.println("Picklist values = ");
for (int j = 0; j < picklistValues.length; j++)
{
if (picklistValues[j].getLabel() != null)
{
System.out.println(" Item: " +
picklistValues[j].getLabel());
}
}
}
// Determine whether this field refers to another object
if (referenceTos != null && referenceTos[0] != null)
{
System.out.println("Field references the following objects:");
for (int j = 0; j < referenceTos.length; j++)
{
System.out.println(" " + referenceTos[j]);
}
}
}
}
}
}
catch (Exception ex) {
System.out.println("\nFailed to get object descriptions, error message was: \n" +
ex.getMessage());
}
}
}
----------------------------
in this line appear one error--> DescribeSObjectResult[] describeSObjectResults =
binding.describeSObjects(new String[] {"account", "contact", "lead"});
quickstart2.java:27: cannot find symbol
ÏϧÏsymbol : variable binding
ÏϧÏlocation: class org.salesforce.quickstart.quickstart2
ÏÏ§Ï binding.describeSObjects(new String[] {"account", "contact", "lead"});
I suppose i need an import, but i don't know which.
THANKS!
Why don't you download the quickstart and use that ?