Query.apex

  • Docs
  • Tutorials
Docs Menu
  • Query class
    • Constructor
    • Result
    • Field Selection
    • Condition
    • Subquery
    • Aggregate Functions

Constructor Guide

Constructors of Query

Constructor

Creates a new Query instance.

public Query(String objectName)

objectName: Name of the expected object.

Query query = new Query('Account');

public Query(Schema.SObjectType objectType)

objectType: An schema SObject type

Query query = new Query(Account.getSObjectType());

Contribute on Github! Edit this section.