You need to sign in to do that
Don't have an account?
cml9
Compile Error: Loop condition must be of type Boolean
public class wrapperExample2 { List <Product_Entry__c> ProdList=new List<Product_Entry__c>(); List <wrapper> lstw =new List<wrapper>(); public List<wrapper> getlstWrapperString() { ProdList=[select name,Price__c from Product_Entry__c]; for (integer i=0; ProdList.size();i++) { lstw.add(new wrapper(ProdList[i].name,ProdList[i].Price__c)); } return lstw; } public Class wrapper { public string name {get;set;} public decimal price {get;set;} public wrapper(string Name,decimal Price) { this.Name = Name; this.Price = Price; } } }
Example 1:-
Example 2:- Your final code should be like below
All Answers
It will break for loop after iteration of list.
Example 1:-
Example 2:- Your final code should be like below
please correct this line your code is right
Thanks & Regards
Jasveer Singh
Please see https://developer.salesforce.com/forums/ForumsMain?id=906F0000000QtfwIAC.