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

Custom controller -return list
Hi ,
iam trying to write a custom controller as below but i get the folowing error in the highlighted line:
Error: Compile Error: Return value must be of type: SOBJECT:Product_Serial__c at line 12 column 13
How do i return a list from the controller?
Please help!
public class iresv {
list<Product_serial__c> pserial=new list<Product_serial__c>();
public iresv(){
pserial=[select id, name from product_serial__c where product__c in (select product__c from order_line__c where id =
:ApexPages.currentPage().getParameters().get('id'))];
}
public Product_serial__c getSerial() {
return pserial;
}
public PageReference save() {
update pserial;
return null;
}
}
Make this change,
public List<Product_serial__c> getSerial() {
return pserial;
}
All Answers
Make this change,
public List<Product_serial__c> getSerial() {
return pserial;
}
Worked perfectly! Thank you Imran!