+ Start a Discussion
PranavLPranavL 

Invalid Identifier for custom object

Hello,

 

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:

 

<apex:page
    showHeader="true" sidebar="false"
    controller="TSWPageController"
    id="Page1"
    standardStylesheets="true"
    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.

 

Thanks!

 

Pranav

 

 

 

 

bob_buzzardbob_buzzard

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?

PranavLPranavL

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

 

Pranav

 

mikefitzmikefitz

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 {
     get{
            if(e==null){
                 e = new Event__c();
             }
           return e;
         }
      set;
}