• AXandSF_Alex
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I'm getting this error:

 

Description	Resource	Path	Location	Type
Save error: Unknown property 'OpportunityStandardController.getLines'	AlexHelloWorld.page	/SFDC/src/pages	line 0	Force.com save problem

 Here is my visual force page:

<apex:page standardController="Opportunity" extensions="AlexHelloWorld">
    <apex:form >
        <apex:pageBlock title="Edit account for {!$User.FirstName}">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputText value="Test - {!retVal}">
                </apex:outputText>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
                <apex:outputText value="OppId - {!opportunity.id}" />
                <apex:outputText value="UserId - {!$User.Id}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection>
            	<apex:repeat value="{!getLines}" var="line" id="theRepeat">
            		<tr>
            			<td valign="top"><apex:outputField value="{!line.Id}" /></td>
            			<td valign="top"><apex:outputField value="{!line.OpportunityId}" /></td>
            			<td valign="top"><apex:outputField value="{!line.PricebookEntryId}" /></td>
            			<td valign="top"><apex:outputField value="{!line.Quantity}" /></td>
            		</tr>
            	</apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 Here is my controller:

public with sharing class AlexHelloWorld {

    public boolean 	showFedEx{get;set;}
    public String	mystr{get;set;}
    public Id		opportunityId{get;set;}
    
    //public Opportunity opportunity{get;set;}
    public Decimal retVal{get;set;}
    
    //Main controller class
    public AlexHelloWorld(ApexPages.StandardController controller)
    {
    	mystr = [SELECT Email from User where Id =:Userinfo.getUserId()].Email;
        showFedEx = true;
        retVal = 5*5;
        System.debug('zzzzz');
    }
    
    public List<OpportunityLineItem> getLines()
    {    	
		List<OpportunityLineItem> oli = [SELECT Id, OpportunityId, PricebookEntryId, Quantity FROM OpportunityLineItem where id =:System.currentPageReference().getParameters().get('id')];
		
		return oli;    	
    }
}

 

Any ideas?

I'm getting this error:

 

Description	Resource	Path	Location	Type
Save error: Unknown property 'OpportunityStandardController.getLines'	AlexHelloWorld.page	/SFDC/src/pages	line 0	Force.com save problem

 Here is my visual force page:

<apex:page standardController="Opportunity" extensions="AlexHelloWorld">
    <apex:form >
        <apex:pageBlock title="Edit account for {!$User.FirstName}">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputText value="Test - {!retVal}">
                </apex:outputText>
            </apex:pageBlockSection>
            <apex:pageBlockSection >
                <apex:outputText value="OppId - {!opportunity.id}" />
                <apex:outputText value="UserId - {!$User.Id}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection>
            	<apex:repeat value="{!getLines}" var="line" id="theRepeat">
            		<tr>
            			<td valign="top"><apex:outputField value="{!line.Id}" /></td>
            			<td valign="top"><apex:outputField value="{!line.OpportunityId}" /></td>
            			<td valign="top"><apex:outputField value="{!line.PricebookEntryId}" /></td>
            			<td valign="top"><apex:outputField value="{!line.Quantity}" /></td>
            		</tr>
            	</apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 Here is my controller:

public with sharing class AlexHelloWorld {

    public boolean 	showFedEx{get;set;}
    public String	mystr{get;set;}
    public Id		opportunityId{get;set;}
    
    //public Opportunity opportunity{get;set;}
    public Decimal retVal{get;set;}
    
    //Main controller class
    public AlexHelloWorld(ApexPages.StandardController controller)
    {
    	mystr = [SELECT Email from User where Id =:Userinfo.getUserId()].Email;
        showFedEx = true;
        retVal = 5*5;
        System.debug('zzzzz');
    }
    
    public List<OpportunityLineItem> getLines()
    {    	
		List<OpportunityLineItem> oli = [SELECT Id, OpportunityId, PricebookEntryId, Quantity FROM OpportunityLineItem where id =:System.currentPageReference().getParameters().get('id')];
		
		return oli;    	
    }
}

 

Any ideas?