You need to sign in to do that
Don't have an account?
Shivani Thapar
Anyone know whats wrong with my apex class...
Im trying to create a apex class for all my unpaid invoices...
anyone know why im getting this error? thanks
anyone know why im getting this error? thanks
public class FindunpaidInvoices {
private final List<Invoice_Consulting__c> invoices;
public FindunpaidInvoices() {
invoices = [select Account__c, Invoice_Date__c, Balance_Due__c, from Invoice_Consulting__c = 'Unpaid'];
}
public List<Invoice_Consulting__c> getUnpaidInvoices() {
return invoices;
}
}
heres code:
public class FindunpaidInvoices {
private final List<Invoice_Consulting__c> invoices;
public FindunpaidInvoices() {
invoices = [select Account__c, Invoice_Date__c, Balance_Due__c from Invoice_Consulting__c = 'Unpaid'];
}
public List<Invoice_Consulting__c> getUnpaidInvoices() {
return invoices;
}
}
invoices = [select Account__c, Invoice_Date__c, Balance_Due__c from Invoice_Consulting__c where Name = 'Unpaid'];
you forgot the where criteria and the name of the field for wich the value is 'Unpaid'
Jerome
invoices = [select Account__c, Invoice_Date__c, Balance_Due__c from Invoice_Consulting__c WHERE Some_Field__c = 'Unpaid'];
Some_Field__c will be replaced with whichever field on your object you are checking.