• ramudu
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

I created the Custom object named by Invoice__c, i want custom page for save the relevant data in this object ...so i create the page controller class as given below

 

 

public class MyControllerInvoice 
{
public Invoice__c invoice;
public MyControllerInvoice() 
{
invoice= [select name from Invoice__c where id =
:ApexPages.currentPage().getParameters().get('id')];
}
public PageReference save()
 {
update invoice;
return null;
}
}
the page is
<apex:page controller="MyControllerInvoice" tabStyle="Invoice__c">
<apex:form>
<apex:pageBlock title="Invoice">
<apex:pageBlockSection>
<apex:inputField value="{!Invoice__c.name}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
when i save this page the error is occur    Error: Unknown property 'MyControllerInvoice.Invoice__c'
How to solve this ... pls help.. thanks in advance

 

  • January 25, 2011
  • Like
  • 0

Hi I have added a apex controller to my vf page in which I am trying to return a list of a related objects that I am then going to display in the vf page in a apex:datatable. I'm able to create the controller extension no problem but when I view the vf page I get this error:

 

Error: Unknown property 'VisualforceArrayList.Name'

Apex Code:

public class event_session {
private SBS_Event__c sbs_event;


public event_session(ApexPages.StandardController controller) {
this.sbs_event =
(sbs_event__c)controller.getRecord();
}

List<event_sessions__c> event_session = new List<event_sessions__c>();

public List<event_sessions__c> EventSession {
get{
event_session = [Select e.Lecture_Event_Period__c, e.Name from Event_Sessions__c e Where e.SBS_Event__c = :sbs_event.id Order by e.CreatedDate];
return event_session;
}
}




}

 

vf code:
 

//vf fragment<apex:page showHeader="false" standardController="SBS_Event__c" extensions="event_session" > <apex:composition template="StdOCEITemplate" > <apex:define name="pagebody"> <apex:pageBlock title="Event Registration Form"> <apex:form > <table width="100%" border="0" cellspacing="4" cellpadding="0"> <tr> <th width="20%" scope="col">&nbsp;</th> <th width="80%" scope="col">&nbsp;</th> </tr> <tr> <th scope="row" style="">Event:</th> <td style="text-align:left;padding-left:10px;"><strong>{!SBS_Event__c.name}</strong></td> </tr>