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
AndreiGAndreiG 

Display records from a custom object?

Hi! I would like to display data with VFpage from a custom object. A table with the all records. How can I do that? Do I need to set a custom controller.

 

Thanks

 

AG

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You have a single underscore character there - custom objects require two underscores:

 

Catalog__c  (rather than Catalog_c)

All Answers

bob_buzzardbob_buzzard

You shouldn't need a custom controller for this, although it does depend on your exact requirements.

 

I'd suggest you take a look at the Visualforce Developer's Guide, Standard List Controllers section.  This has some really good examples that may fit your requirements (including pagination etc).

 

You can find this section at:

 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_controller_sosc_about.htm|StartTopic=Content%2Fpages_controller_sosc_about.htm|SkinName=webhelp

AndreiGAndreiG

Thanks for a quick reply! Yes I using this guide. But...

 

The custom object name is "Catalog"

when I write: <apex:page standardController="Catalog" ........ it shows

ErrorError: Catalog does not exist

 

Can you guide me what I am doing wrong...

 

Thanks!

bob_buzzardbob_buzzard

Your custom object API name will have an __c appended to distinguish it from standard objects.

 

Thus you'd have:

 

 

<apex:page standardController="Catalog__c" 

 

 

AndreiGAndreiG

Thank you. i have tried it also before, but it didn't work too. It doesn't matter  "Catalog" or "Catalog_c", it just doesn't work. The custom object exists and has the name "Catalog"

 

ErrorError: Catalog_c does not exist

 

Any idea?

bob_buzzardbob_buzzard

You have a single underscore character there - custom objects require two underscores:

 

Catalog__c  (rather than Catalog_c)

This was selected as the best answer
AndreiGAndreiG

It worked! Thanks a lot!  :smileyhappy: