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
Yamile Pacheco CuevaYamile Pacheco Cueva 

Name Error

New to visualforce

I keep getting this error when I create visualforce pages. The developer console says the error is in line 0, which leads me to believe my code is fine and it is just the name that is returning the error. How can I fix this?

It does not matter what name i give it, I keep getting this error. Help, please!User-added image
Best Answer chosen by Yamile Pacheco Cueva
Rounak SharmaRounak Sharma
Hello,
instead of controller you have to put standard controller =''class__c"

All Answers

Rounak SharmaRounak Sharma
hi yamile,
Can you please check if there is any space after the name you entered.
because it will not allow space either in the beginning or at the end.
Please let me know if it helps.
thanks
Yamile Pacheco CuevaYamile Pacheco Cueva
Hello Rounak,

I checked and there are no spaces in the name. I reopned the vf page today, which saved yesterday but without the code because of the error. I think now the problem is with the code because without the code it saves just fine but with this code then I get the error. What is wrong with it?
 
<apex:page Controller="Class__c" renderAs="pdf">

   <apex:form >
   <apex:pageBlock title="{!Class__c.Name}">
      You are viewing the {!Class__c.Name} roster.
   </apex:pageBlock>
   <apex:pageBlock title="Roster">
      <apex:pageBlockTable value="{!Class__c.Roster__c}" var="roster">
         <apex:column value="{!roster.Contact__c}"/>
         <apex:column value="{!roster.Role__c}"/>
         <apex:column value="{!enrollment.Email__c}"/>
      </apex:pageBlockTable>
      
   </apex:pageBlock>
   
    </apex:form>
</apex:page>

 
Yamile Pacheco CuevaYamile Pacheco Cueva
This now seems to be happening with every page I add code to
Rounak SharmaRounak Sharma
Hello,
instead of controller you have to put standard controller =''class__c"
This was selected as the best answer
Yamile Pacheco CuevaYamile Pacheco Cueva
I also found that I should have referenced Class__c.Roster__c as Class__c.Roster__r.

Thanks!