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
cloudcodernewcloudcodernew 

Displaying tables on VF page..pls help..

I need to include a table on my visualforce page and query the data from the custom objects already developed in Salesforce application. while browsing over the internet, i came thru some controller class example and need to write a visualforce page for that.. I tailored the class shown below as per my requirements, but couldn't write code for the page..Could someone help me in this issue..? total columns to display would be 10. 

 

Its prime urgent and I'm running out of time.. 

 

 

public class OpportunityLineItemsController {
    Public List<OpportunityLineItems> LineItems = new List<OpportunityLineItems>();

    public List<OpportunityLineItems> getLineItems() {
        LineItems =[select id from OpportunityLineItem limit 10];
        return LineItems;
    }

 

 

Secondly:

When i save the below page, it thorws an error.

Save Error:Unknown property 'Billing_Close__cStandardController.Save'..why is this occuring..?

 


<apex:page standardController="Billing_Close__c" showheader="false" sidebar="false">

<apex:sectionHeader title="Billing Close Edit" subtitle="New Billing Close" />

<apex:form>

<apex:pageBlock title="Billing Close Edit">
<apex:pageBlockButtons>

<apex:commandButton action="{!Save}" value="Save" />

<apex:commandButton action="{!Save&New}" value="SaveAndNew" />

<apex:commandButton action="{!Cancel}" value="Cancel" />

</apex:pageBlockButtons>

</apex:pageBlock>

</apex:form>

</apex:page>

.

.

Your help is greatly appreciated.. thanks.

 

MelliottMelliott

First thing I noticed, is If you are trying to reference a custom class you need to reference the OpportunityLineItemsController.  So Controller = OpportunityLineItemsController.  You can't reference the custom class from a standard controller. 

 

If you want to do a table in visualforce you need to use  <apex:dataTable> component.