You need to sign in to do that
Don't have an account?
Rick Rossi
Message Error
I get the following message for my public class however I cant seem to find where the error is.
Error: Unknown property 'String.name'
<apex:page controller="importDataFromCSVController">
<apex:form >
<apex:pagemessages />
<apex:pageBlock >
<apex:pageBlockSection columns="4">
<apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}"/>
<apex:commandButton value="Import Account" action="{!importCSVFile}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageblocktable value="{!accList}" var="acc">
<apex:column value="{!acc.name}" />
<apex:column value="{!acc.AccountNumber}" />
<apex:column value="{!acc.Type}" />
<apex:column value="{!acc.Accountsource}" />
<apex:column value="{!acc.Industry }" />
</apex:pageblocktable>
</apex:pageBlock>
</apex:form>
</apex:page>
Error: Unknown property 'String.name'
<apex:page controller="importDataFromCSVController">
<apex:form >
<apex:pagemessages />
<apex:pageBlock >
<apex:pageBlockSection columns="4">
<apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}"/>
<apex:commandButton value="Import Account" action="{!importCSVFile}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageblocktable value="{!accList}" var="acc">
<apex:column value="{!acc.name}" />
<apex:column value="{!acc.AccountNumber}" />
<apex:column value="{!acc.Type}" />
<apex:column value="{!acc.Accountsource}" />
<apex:column value="{!acc.Industry }" />
</apex:pageblocktable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi Rick,
Visualforce page is Case sensitive so you have to put Name as API Name Of Account.
<apex:column value="{!acc.name}" /> correct this as the below
Please let me know it is working or not?
Please mark it as the Best Answer if it helps you.
Thank You
I keep getting the same message unfortnutaley cant figure out the issue as it seems as if everything is correct.
You can take reference from this below code:- In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.