describeGlobal()

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

Syntax

DescribeGlobalResult = binding.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

private void describeGlobalSample() {
  try
  {
    DescribeGlobalResult describeGlobalResult = null;
    describeGlobalResult = binding.describeGlobal();
    DescribeGlobalSObjectResult[] sobjectResults = describeGlobalResult.getSobjects();
    for (int i=0;i < sobjectResults.length;i++) {
      System.out.println(sobjectResults[i].getName());
    }
  }
  catch (Exception ex)
  {
    System.out.println("\nFailed to return types, error message was: \n" + 
        ex.getMessage());
  }
}

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-2009 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.