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

Pls help in resolving this Error: Unknown property 'String.Week__c'
Please help me in resolving this issue..
My controller:
public class ViewQAAMController {
List<QAAM_Weekly_Planner__c> acc {get; set;}
List<String> strvalues = new LIst<String>();
List<AggregateResult> groupedResults = new List<AggregateResult>();
String week = '';
public ViewQAAMController()
{
String str;
groupedResults.clear();
strvalues.clear();
groupedResults = [select Week__c from QAAM_Weekly_Planner__c Max group by Week__c order by max(createddate) desc LIMIT 10];
if(groupedResults.size() > 0)
{
for(AggregateResult s : groupedResults)
{
strvalues.add('' + s.get('Week__c'));
}
}
acc.clear();
for(String s: strvalues)
{
QAAM_Weekly_Planner__c wp = new QAAM_Weekly_Planner__c();
wp.Week__c = s;
acc.add(wp);
}
}
}
My VF
<apex:page controller="ViewQAAMController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable var="data" value="{!acc}">
<apex:column value="{!data.Week__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I wanted to print the values from my contructor in pageblocktable.
Kindly help, i get below error.
Error: Unknown property 'String.Week__c'
My controller:
public class ViewQAAMController {
List<QAAM_Weekly_Planner__c> acc {get; set;}
List<String> strvalues = new LIst<String>();
List<AggregateResult> groupedResults = new List<AggregateResult>();
String week = '';
public ViewQAAMController()
{
String str;
groupedResults.clear();
strvalues.clear();
groupedResults = [select Week__c from QAAM_Weekly_Planner__c Max group by Week__c order by max(createddate) desc LIMIT 10];
if(groupedResults.size() > 0)
{
for(AggregateResult s : groupedResults)
{
strvalues.add('' + s.get('Week__c'));
}
}
acc.clear();
for(String s: strvalues)
{
QAAM_Weekly_Planner__c wp = new QAAM_Weekly_Planner__c();
wp.Week__c = s;
acc.add(wp);
}
}
}
My VF
<apex:page controller="ViewQAAMController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable var="data" value="{!acc}">
<apex:column value="{!data.Week__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I wanted to print the values from my contructor in pageblocktable.
Kindly help, i get below error.
Error: Unknown property 'String.Week__c'
All Answers