You need to sign in to do that
Don't have an account?
Nagaraju Mogili
I was unable to execute the code
Apex code
public class me {
public list<Schema.Account> Acc {get;set;}
public me (){
list<Schema.Account> Acc = new list<Schema.Account>();
Acc = [select id,name,phone from Account];
}
}
VF code::
<apex:page controller="me" sidebar="false">
<apex:form >
<apex:pageblock id="pb">
<apex:pageblocktable value="{!acc}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone}"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
public class me {
public list<Schema.Account> Acc {get;set;}
public me (){
list<Schema.Account> Acc = new list<Schema.Account>();
Acc = [select id,name,phone from Account];
}
}
VF code::
<apex:page controller="me" sidebar="false">
<apex:form >
<apex:pageblock id="pb">
<apex:pageblocktable value="{!acc}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone}"/>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
public list<
Schema.Account> Acc {get;set;} => public list <Account> Acc {get;set;}Use Schema.object_name to refer to an sObject that has the same name as a custom class.
This disambiguation instructs the Apex runtime to use the sObject.
// Create a standard Account object myAccountSObject
Schema.Account myAccountSObject = new Schema.Account();
// Create accountClassInstance, a custom class in your org
Account accountClassInstance = new Account();
myAccountSObject.Name = 'Snazzy Account';
accountClassInstance.myInteger = 1;
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_schema_namespace_using.htm?search_text=Schema.account