You need to sign in to do that
Don't have an account?

How to get the 1st 200 records in account object
Hi Everyone,
How to get the 1st 200 records in account object using pagenation
can anyone explain with sample code please..
Thanks&Records
neeru
Use StandardSetController...
http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm
Set your setPageSize parameter to limit 200 records at a time.
Thanx For replay Alex
i wrote controller for that its working oppurtinity obj fine..but its not working for account object
can u share some sample code of account obj for that please??
should be the same way you did opportunity....
Thanks Alex now it works fine...i dint found the accept ur solution button..because only i am not marked ur solution sorry for that
and one more question Alex
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??
can you help this scenario with some sample code please??
Thanks&Regards
neeru
This should give you the proper information...
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_component.htm
as far as the attribute you'll be passing it, I would define it as a the instance class for that sObject... IE:
Ya dat's ok alex..dis is my controller i am getting error like unexpected token line 11.....i think i am facing the problem on database.query() in that i am writing a query dat one not executed ...can you check dis controlle once alex please
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.getQueryL
ocator(
[SELECT obj.getDescribe().getName() from sObject]));
}
public ApexPages.StandardSetController setCon {
get{
return setCon;
}
set;
}
// Initialize setCon and return a list of records
public List<sObject> getacc() {
return (List<sObject>) setCon.getRecords();
}
}