function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
karthic sankar 9karthic sankar 9 

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'
Best Answer chosen by karthic sankar 9
karthic sankar 9karthic sankar 9
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000Qzd3QAC solved with help of this thread

All Answers

David Zhu 🔥David Zhu 🔥
It seems to me Week__c field on QAAM_Weekly_Planner__c object is not a text data field.
karthic sankar 9karthic sankar 9
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000Qzd3QAC solved with help of this thread
This was selected as the best answer