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
DennoPDennoP 

Displaying customer object on visualforce page

I have a customer oject called 'Employee_c' and I want to display some of the fields within that object on my visualforce page sucha as 'Name'.  Every time I try to add this object to by custom controller I get the following error.  Am I using the wrong syntax for custom ojects? The API name for my custom object is Employee_c.

Code example:
Employee_c Emp1;

Error:
Error: Compile Error: Invalid type: Employee_c at line 4 column 1

I was to be able to do the same as I do with account or other standard objects on a visualforce page.

The standard oject code work fine?
Account account;

public Account getAccount() {
        if (account == null)
            account =[select id, name from Account
                     where id = '001R0000008SVv7'];
            return account;
    }

Please help!

kyleRochekyleRoche
Are you sure it's not Employee__c (two underscores?)
DennoPDennoP
:smileyvery-happy:

Happy Days!!

This worked fine.  I hadn't spotted that it was two underscored.

Thanks very very much.