+ Start a Discussion
KbhaskarKbhaskar 

dynamic for loop

hi,
I do have a requirement where we need to use for loop  with if statement for multiple fields if selected ,is it possible ?
}	
public pagereference actionsupport()                 //pageReference method
	{
		lstwrapperIntString = new List<wrapper>();       //new lstwrapperIntString list
		Map<String, SobjectField> fieldMap = Opportunity.getsObjectType().getDescribe().Fields.getMap(); 
		for(String f : fieldMap.keySet())
		{
			lstwrapperIntString.add(new wrapper(fieldMap.get(f).getDescribe().getLabel(),selectedValue));
		}
		return null;
	}
	public class wrapper    //Wrapper Class 
	{
		public boolean selectedread  {get;set;}
		public boolean selectedwrite {get;set;}

		public String  fieldName     {get;set;}

		public wrapper(String Name,String write) // wrapper constructor 
		{
			this.fieldName=Name;                     
			this.selectedread=true;
			if(write=='writeseleted')
			{
				this.selectedwrite=true;
			}
		}  
	}

 
Best Answer chosen by Kbhaskar
Tejpal KumawatTejpal Kumawat
Hello Bhaskar,

Can you elaborate your query/use case?

Regards
Tej palKumawat