describeGlobal()

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

Syntax

DescribeGlobalResult = sfdc.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();
    String[] types = describeGlobalResult.getTypes();
    for (int i=0;i<types.length;i++)
      System.out.println(types[i]);
    getUserInput("\nDescribe global was successful.\n\n
                       Hit the enter key to continue....");
  }
  catch (Exception ex)
  {
    System.out.println("\nFailed to return types, error message was: \n" + 
                       ex.getMessage());
    getUserInput("\nHit return to continue...");
  }
}

Sample Code—C#

private void globalDescribe() 
{
   //Invoke describeGlobal call and save results in DescribeGlobalResult object 
   DescribeGlobalResult dgr = binding.describeGlobal(); 

   // Iterate through the results 
   for (int i=0;i<dgr.types.Length;i++)  
   {
      // The dgr.types[i] object is a string 
      System.Diagnostics.Trace.WriteLine(dgr.types[i]); 
   }
   binding.describeSObject 
}

Arguments

None.

Response

DescribeGlobalResult

Fault

UnexpectedErrorFault

See Also:
describeSObjects()
API Call Basics
Using the Partner WSDL
https://wiki.apexdevnet.com/index.php/Sample_SOAP_Messages
© Copyright 2000-2008 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.