You need to sign in to do that
Don't have an account?

Error: Constructor not defined: [ApexPages.StandardController].<Constructor>(List<npe01__OppPayment__c>)
I am getting a constructor not defined error in Apex class when I make a List of the custom object.
Here is my code:
public with sharing class Receivable_Opp {
public ApexPages.StandardController myRecController{get;set;}
public List<npe01__OppPayment__c> Rec {get; set;}
public ApexPages.StandardController standardOppController;
public Receivable_Opp(ApexPages.StandardController cntrl){
standardOppController = cntrl;
Opportunity opp = (Opportunity)cntrl.getRecord();
Rec = [Select CreatedDate, SystemModstamp, npe01__Opportunity__c, npe01__Paid__c, npe01__Scheduled_Date__c FROM npe01__OppPayment__c WHERE npe01__Paid__c = true and npe01__Opportunity__c = :opp.Id limit 1];
myRecController = new ApexPages.StandardController(Rec);
}
}
If someone can help me resolve the issue, it would be of great help. Thanks.
Here is my code:
public with sharing class Receivable_Opp {
public ApexPages.StandardController myRecController{get;set;}
public List<npe01__OppPayment__c> Rec {get; set;}
public ApexPages.StandardController standardOppController;
public Receivable_Opp(ApexPages.StandardController cntrl){
standardOppController = cntrl;
Opportunity opp = (Opportunity)cntrl.getRecord();
Rec = [Select CreatedDate, SystemModstamp, npe01__Opportunity__c, npe01__Paid__c, npe01__Scheduled_Date__c FROM npe01__OppPayment__c WHERE npe01__Paid__c = true and npe01__Opportunity__c = :opp.Id limit 1];
myRecController = new ApexPages.StandardController(Rec);
}
}
If someone can help me resolve the issue, it would be of great help. Thanks.
public with sharing class Receivable_Opp {
public Opportunity opp{Get;set;}
public List<npe01__OppPayment__c> Rec {get; set;}
public Receivable_Opp(ApexPages.StandardController cntrl){
Rec = [Select CreatedDate, SystemModstamp, npe01__Opportunity__c, npe01__Paid__c, npe01__Scheduled_Date__c FROM npe01__OppPayment__c WHERE npe01__Paid__c = true and npe01__Opportunity__c = : ApexPages.currentPage().getParameters().get('id')];
//The Above line will Pass the Opportunity Id to the npe01__OppPayment__c
}
<apex:repeat value="{!Rec }" var="r">
<tr><Td>{!rec.npe01__Scheduled_Date__c }</td></tr>
</apex:repeat>
All Answers
What exactly you are trying to do?
Try this,
public with sharing class Receivable_Opp {
public Opportunity opp{Get;set;}
public List<npe01__OppPayment__c> Rec {get; set;}
public Receivable_Opp(ApexPages.StandardController cntrl){
Rec =[Select CreatedDate, SystemModstamp, npe01__Opportunity__c, npe01__Paid__c, npe01__Scheduled_Date__c FROM npe01__OppPayment__c WHERE npe01__Paid__c = true and npe01__Opportunity__c = : ApexPages.currentPage().getParameters().get('id')];
//The Above line will Pass the Opportunity Id to the npe01__OppPayment__c
}
Thanks it removed the error but now it gives an error in the visualforce page :Unknown property 'VisualforceArrayList.npe01__Scheduled_Date__c'
Here is my VF code:
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf" extensions="contact_opp,Receivable_Opp">
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
<td>
<img src='{!URLFOR($Resource.Logo4567687)}' title="logo" />
</td>
<p align="center"><font face="Arial"><i>{!$Organization.Name}</i></font><br/>
<font face="Arial"><i>{!$Organization.Street}</i></font><br/>
<font face="Arial"><i>{!$Organization.City}</i></font>
<font face="Arial"><i>,{!$Organization.State}</i></font>
<font face="Arial"><i>{!$Organization.PostalCode}</i></font></p>
<!--<td align="right"><font face="Arial" >
<b>Invoice for {!Opportunity.Account.Name}</b></font><br/>
</td>-->
</tr>
<hr/>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr> <td width="65%"><font face="Arial" >
Federal Tax ID: 27-0580207<br/>
</font></td>
<!--<td width="50%"> </td>-->
<td width="50%"><font face="Arial">Invoice number: <apex:repeat value="{!Opportunity.Invoices__r}" var="line2">
{!line2.name}</apex:repeat></font><br/>
<font face="Arial">Invoice Date: <apex:repeat value="{!Opportunity.Invoices__r}" var="line2">
{!line2.Invoice_Date__c} </apex:repeat></font></td>
</tr>
</table>
<br/>
<hr/>
<p><b><font face="Arial" color="#000080">Address Information</font></b></p>
<table border="0" width="100%" id="table2">
<tr>
<td colspan="3">
<font face="Arial">Child name: {!Opportunity.Account.Name} <br/><br/></font>
</td>
</tr>
<tr>
<td>
<font face="Arial">{!Contact.Name}<br/>
{!Opportunity.Account.BillingStreet}<br/>
{!Opportunity.Account.BillingPostalCode} {!Opportunity.Account.BillingCity}
</font>
</td>
<!--<td width="50%"></td>
<td >
<font face="Arial">Ship To:<br/>
{!Opportunity.Account.ShippingStreet}<br/>
{!Opportunity.Account.ShippingPostalCode} {!Opportunity.Account.ShippingCity}
</font>
</td>-->
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Invoice Detail</font></b></p>
<table border="0" width="100%" id="table4">
<tr>
<td bgcolor="#C0C0C0"><font face="Arial">Item</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Total Price</font></td>
</tr>
<tr>
<apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
<tr>
<td>{!line.PricebookEntry.Name}</td>
<td><apex:OutputField value="{!line.TotalPrice}"/></td>
</tr>
</apex:repeat>
</tr>
<tr>
<td bgcolor="#C0C0C0" align="right" colspan="4">
<font face="Arial"><b>Total:</b> <apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>
<table border="0" width="100%" id="table4">
<tr>
<td bgcolor="#C0C0C0"><font face="Arial">Post Date</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Due Date</font></td>
<!--<td bgcolor="#C0C0C0"><font face="Arial">Description</font></td> -->
<td bgcolor="#C0C0C0"><font face="Arial">Credit</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Debit</font></td>
</tr>
<tr>
<apex:repeat value="{!Rec}" >
<td>{!Rec.npe01__Scheduled_Date__c}</td>
<td>{!Rec.npe01__Scheduled_Date__c}</td>
<!--<td>{!line.Description}</td> -->
<td><apex:OutputField value="{!Opportunity.npe01__Payments_Made__c}"/></td>
<td><apex:OutputField value="{!Opportunity.npe01__Amount_Outstanding__c}"/></td>
</apex:repeat>
</tr>
</table>
<br/>
<hr/>
<!--<p><b><font color="#000080" face="Arial">Terms and Conditions</font></b></p>
<table border="0" width="100%" id="table3">
<tr>
<td><font face="Arial">
Payment Method: <apex:OutputField value="{!Opportunity.QuotePaymentMode__c}"/><br/>
Payment Terms: <apex:OutputField value="{!Opportunity.QuotePaymentTime__c}"/><br/>
Billing Frequency: <apex:OutputField value="{!Opportunity.QuoteBillingFrequency__c}"/><br/>
</font>
</td>
</tr>
</table>
<br/>
<p><font face="Arial">{!Opportunity.Conditions__c}</font></p>
<br/>
<hr/>
<table width="100%" id="table5">
Special Terms:
</table>
<p> </p>
<hr/>-->
<p align="center"><font face="Arial"><i>Copyright {!$Organization.Name}.</i></font></p>
</apex:page>
public with sharing class Receivable_Opp {
public Opportunity opp{Get;set;}
public List<npe01__OppPayment__c> Rec {get; set;}
public Receivable_Opp(ApexPages.StandardController cntrl){
Rec = [Select CreatedDate, SystemModstamp, npe01__Opportunity__c, npe01__Paid__c, npe01__Scheduled_Date__c FROM npe01__OppPayment__c WHERE npe01__Paid__c = true and npe01__Opportunity__c = : ApexPages.currentPage().getParameters().get('id')];
//The Above line will Pass the Opportunity Id to the npe01__OppPayment__c
}
<apex:repeat value="{!Rec }" var="r">
<tr><Td>{!rec.npe01__Scheduled_Date__c }</td></tr>
</apex:repeat>