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
david masonisdavid masonis 

import?

for this code:
 

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!

 

SuperfellSuperfell
well, where did you declare the binding variable ? (perhaps you should stick to trying to learn one new thing at a time, learn java, then learn the salesforce API)
david masonisdavid masonis
but I got the code from this page...
SuperfellSuperfell
You can't take the snippets in insolation, they're part of a larger project,and you need the rest of code.

Why don't you download the quickstart and use that ?
LimenitisLimenitis

Hi all ,
 
  Can anyone bring out the difference between a regular API and an Apex API. Is that means the usage of the URL's.Please brign out the difference soon..
 
is that the usage of the url https://www.salesforce .com is the regular and the https://login.salesforce .com is APEX?
 
seeking your reply..
 
thanks