function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Database.getQueryLocator([SELECT obj.getDescribe().getName() from sObject]));

Hi Everyone,


my need is when i write a componet  and  i call that componet in my visualforce page  it shows objectname(Account) and fieldname(phone) with in the pageblocktable and i use this componet in another object(contact) it will also display like this only...


how i pass the values dynamically in components??





I am are getting Error in Controller like
 unexpected token: ')' at line 11 column 33



public class testcon {
public String acon{get; set;}

    // ApexPages.StandardSetController must be instantiated
    // for standard list controllers
    public testcon(){
    list<Schema.SObjectType> obj = Schema.getGlobalDescribe().Values();
    ApexPages.StandardSetController setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
         [SELECT obj.getDescribe().getName() from sObject]));
    public ApexPages.StandardSetController setCon {
            return setCon;

    // Initialize setCon and return a list of records
    public List<sObject> getacc() {
        return (List<sObject>) setCon.getRecords();




You can't query SObject. You'll have to construct a query string from Schema.getGlobalDescribe() and/or Schema.SObjectType.getDescribe() functions.


thanx for replay me Sfdcfox  i am not getting totally...can you explain with some sample query please or othewise please modify the above query