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
RV328RV328 

Please help - Error: Unknown property 'String.Name'

Here is the code:

<apex:page standardController="Account">
    <apex:pageBlock title="{! $User.FirstName} {! $User.LastName}">
        You are viewinf account of {! account.name}
    </apex:pageBlock>
    
    <apex:pageBlock title="Contacts">
        <apex:form>
            <apex:dataTable value=" {! account.Contacts}" var="AC" cellpadding="4" border="1">
                <apex:column>
                    <apex:facet name="header"> Name </apex:facet>
                        <apex:commandLink reRender="detail">
                        {! AC.Name}
                        <apex:param name="cid" value="{! AC.id}"/>
                        </apex:commandLink>
                </apex:column>
                <apex:column>
                    <apex:facet name="header"> Phone </apex:facet>
                    {! AC.Phone}
                </apex:column>
            </apex:dataTable>
        </apex:form>
    </apex:pageBlock>
    <apex:outputPanel id="detail">
        <apex:detail subject="{! $CurrentPage.parameters.cid}" inlineEdit="false" relatedList="false" title="false"/>
    </apex:outputPanel>
</apex:page>
Best Answer chosen by RV328
Himanshu ParasharHimanshu Parashar
Hi,

Your whitespace is creating problem. 
 
value=" {! account.Contacts}" //wrong code

 
value="{!account.Contacts}"

Plaese notice whitespace before {!account.Contacts}

Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

All Answers

Himanshu ParasharHimanshu Parashar
Hi,

Your whitespace is creating problem. 
 
value=" {! account.Contacts}" //wrong code

 
value="{!account.Contacts}"

Plaese notice whitespace before {!account.Contacts}

Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant

P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
This was selected as the best answer
ManojjenaManojjena
Hey ,
  Can you do one thing ,just change the dataTable to pageblock table and save ,then edit and change to dataTable .
Any issue let me know.
ManojjenaManojjena
Also you are using Name which is not there in contact .You can use FirstName /LastName  in place of Name .