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
Vincent Drader 2Vincent Drader 2 

Custom Object Controller for VisualForce Page

I am having an issue with a VisualForce page. I am relatively new at coding in visualforce, and have gotten standard pages to work, but this is the first time with a custom object. My custom object API name is "Internal_Request__c", thus, I put <apex:page standardController="Internal_Request__c"> as my controller. Is this correct? I currently get an error called "Error: Unknown property 'Internal_Request__cStandardController.Internal_Request__c'. See below.

User-added image
Any thoughts?
Best Answer chosen by Vincent Drader 2
Mahesh DMahesh D
Try this first

<apex:page standardController="Internal_Request__c" renderAs="PDF" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" >

</apex:page>

And also please check the API name of Custom Object.

If this works then go step by step and add the code, also keep clicking the  'Quick Save' regularly.

Regards,
Mahesh 

All Answers

Mahesh DMahesh D
Please paste the VF page here.

Also also try commenting everything, just save with one <apex:page tag.

Regards,
Mahesh
Vincent Drader 2Vincent Drader 2
<apex:page standardController="Internal_Request__c" renderAs="PDF" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" >
<head>
<style type="text/css">
@page {
         size: letter;
         margin-top: 5mm;
         @top-center {
                 content: "";
                }
               }
.page-break {
                display:block;
                page-break-after:always;
            }
body {
                font-family: Arial Unicode MS;
            }
th {font-style: bold;
    font-size: 14px;
    }
.fixed {font-size: 14px;
        font-weight: bold;
        font-style: italic;
}
 
</style>
</head>
<body style="font-size: 14px;">
<div>
<div style="float:left"><img width="150" height="auto" src="https://c.na11.content.force.com/servlet/servlet.ImageServer?id=015G0000001U7bs&oid=00DA0000000bMS6&lastMod=1360259579000"></img>
</div>
<div style="float:right"><u>New Employee IT Checklist</u>
<br></br><br></br>
Requestor and Requested Date:&nbsp;<apex:outputText value="{!Internal_Request__c.CreatedBy}"> </apex:outputText>
 
</div>
</div>
<br></br>
<br></br><br></br>
 
<u>EMPLOYEE DETAILS</u>:
<br></br>
<u>Name</u>: <apex:outputText value="{!Internal_Request__c.First_Name__c}"> </apex:outputText> &nbsp; <apex:outputText value="{!Internal_Request__c.Last_Name__c}"> </apex:outputText>
<br></br>
<u>Department</u>: <apex:outputText value="{!Internal_Request__c.Department__c}"> </apex:outputText>
<br></br>
<u>Employee Start Date</u>: <apex:outputText value="{!Internal_Request__c.Start_Date__c}"> </apex:outputText>
<br></br>
<u>IT REQUEST DETAILS</u>
<table width="80%" align="center">
<tr>
<td><u>Needs email account</u>?&nbsp;&nbsp;<apex:outputText value="{!Internal_Reqest__c.Listed_on_Website__c}"></apex:outputText>
<br></br>
<u>Email Address</u>:&nbsp;&nbsp;<apex:outputText value="{!Internal_Request__c.Email_Account__c}"> </apex:outputText>
<br></br>
<u>Other Email Access</u>:&nbsp;&nbsp;<apex:outputText value="{!Internal_Request__c.Other_Email_Access__c}"> </apex:outputText>
</td>
<td><u>Needs desk phone</u>?&nbsp;&nbsp;<apex:outputText value="{!Internal_Reqest__c.DID__c}"></apex:outputText></td>
<br></br>
<u>Phone</u>:&nbsp;&nbsp;<apex:outputText value="{!Internal_Request__c.Phone__c}"> </apex:outputText>
<br></br>
<u>Phone Extension</u>:&nbsp;&nbsp;<apex:outputText value="{!Internal_Request__c.Phone_Extension__c}"> </apex:outputText>
</tr>
<tr>
<td><u>Employee added to website</u>?&nbsp;&nbsp;<apex:outputText value="{!Internal_Reqest__c.Listed_on_Website__c}"></apex:outputText></td>
<td><u>CRM Access Level</u>:&nbsp;&nbsp; <apex:outputText value="{!Internal_Request__c.CRM_Access_Level__c}"> </apex:outputText></td>
</tr>
</table>
<br></br>
</body>
</apex:page>


 
Mahesh DMahesh D
Try this first

<apex:page standardController="Internal_Request__c" renderAs="PDF" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" >

</apex:page>

And also please check the API name of Custom Object.

If this works then go step by step and add the code, also keep clicking the  'Quick Save' regularly.

Regards,
Mahesh 
This was selected as the best answer
Vincent Drader 2Vincent Drader 2
Hmmm. You're right. It works with just the apex page tags. But when I paste in the rest, it quits working. Any thoughts?
Mahesh DMahesh D
Hi Vincent,

Go step by step, keep adding the code and clicking on the 'Quick Save' will give you the exact code which is causing you the error.

Regards,
Mahesh