Retrieves a list of available objects for your organization’s data.
DescribeGlobalResult = binding.describeGlobal();
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.
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()); } }
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); } }