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

Invalid Identifier for custom object



I am trying to create a custom wizard which has VF pages and contains custom objects


One of the custom objects is events.


The first VF page header looks like:


    showHeader="true" sidebar="false"
    cache="false" >
<apex:actionsupport reRender="Page1" />


I accpet information as:


<apex:pageBlockSection columns="1" >          
                              <apex:inputField value="{!Event__c.Name}" required="True"/>                  
                              <apex:inputField value="{!Event__c.Type_of_Event__c}" required="True"/> 


When I click save it asks me if I want to create:

Create Apex method 'TSWPageController.getEvent__c'


But I understand that the double underscore is reserved in apex for name and namespaces.


When I click on "Create Apex method 'TSWPageController.getEvent__c'" I get the VF error: Invalid identifier: getEvent__c


How should I work around this?


Any help will be really appreciated.










Your page looks like it is trying to manage a particular instance of the Event__c custom object - if this is the case, have you considered using a standard controller and writing an extension rather than going straight to a custom controller?


Hi Bob,


Thanks for the reply.


The main goal is to create a wizard of 5 VF pages that would be eventually displayed on a website


As one goes through each page, the information gets saved and goes to the next page.


The information to be saved is a mix of standard and custom objects.


Since I have to use the wizard, I think I would need to create a custom controller class for it which would handle the steps.


Hence, I did not consider using a standard controller in my case.


Please correct me if my thinking is incorrect.


Any ideas on how you think I should go about it.


Thanks again for the reply





In your controller how are you instantiating your Event__c sObject. You should be setting it to a variable and you should be calling that variable within the vf page.


Something simple like this.


Event__c e {
                 e = new Event__c();
           return e;