describeGlobal()

Retrieves a list of available objects for your organization’s data.

Syntax

DescribeGlobalResult = connection.describeGlobal();

Usage

Use describeGlobal() to obtain a list of available objects for your organization. You can then iterate through this list and use describeSObjects() to obtain metadata about individual objects.

Your client application must be logged in with sufficient access rights to retrieve metadata about your organization’s data. For more information, see Factors that Affect Data Access.

Sample Code—Java

public void describeGlobal() {
  try {
    DescribeGlobalResult describeGlobalResult = 
        connection.describeGlobal();
    DescribeGlobalSObjectResult[] sobjectResults = 
        describeGlobalResult.getSobjects();
    for (int i = 0; i < sobjectResults.length; i++) {
      System.out.println(sobjectResults[i].getName());
    }
  } catch (ConnectionException ce) {
    ce.printStackTrace();
  }
}

Sample Code—C#

public void DescribeGlobalSample()
{
    try
    {
        // Invoke describeGlobal() call and save results in DescribeGlobalResult object 
    
        DescribeGlobalResult dgr = binding.describeGlobal();

        // Iterate through the results 
    
        //Loop through the array echoing the object names to the console 
    
        for (int i = 0; i < dgr.sobjects.Length; i++)
        {
            Console.WriteLine(dgr.sobjects[i] 
    .name);
        }
    }
    catch (Exception e)
    {
        Console.WriteLine("Failed to return types, error message was: ");
        Console.WriteLine(e.Message);
        Console.WriteLine(e.StackTrace);
        Console.WriteLine(e.InnerException);
    }
}

Arguments

None.

Response

DescribeGlobalResult

Fault

UnexpectedErrorFault

© Copyright 2000–2012 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.