You need to sign in to do that
Don't have an account?
Problem referencing fields in Account Object
The code below creates this error:
Error: Attribute value in <apex:inputField> must contain only a formula expression that resolves to a single controller variable or method in accountDetail at line 5 column 44
------
<apex:page standardController="Account">
<apex:form>
<apex:pageBlock>
Change Account Name: <p>
<apex:inputField Value="{ !Account.Name}"/> <p/>
<apex:commandButton action="{ !save}" value="Save New Account" />
</apex:pageBlock>
</apex:form>
<apex:detail relatedList="false"/>
<apex:relatedList list="Contacts" />
<apex:relatedList list="Opportunities"/>
</apex:page>
-----
Since 'Name' clearly exists as a field, is there something wrong with the syntax of that line?
Also, how can you have a list of all the field names or variable names for a specific object in a window while coding, instead of navigating to the 'Customize' menu?
This tag was incorrect <p/> as it was using a HTML type syntax and caused the error that confused the compiler.
All Answers
<apex:inputField Value="{ !Account.Name}"/>
and then what are these <P/> <p/> for and if there is a function behind wouldn't it be <p> </p>
Thank you for the response. I had actually cleaned all of that up and tested again before submitting the post, but did not update that paste. Those items certainly were not helping!
This tag was incorrect <p/> as it was using a HTML type syntax and caused the error that confused the compiler.
Mitchellb was write , Error was due to <p> tag .
Use can use this code.
<apex:page standardController="Account">
<apex:form>
<apex:pageBlock>
Change Account Name: <p>
<apex:inputField Value="{!Account.Name}"/>
</p>
<apex:commandButton action="{!save}" value="Save New Account" />
</apex:pageBlock>
</apex:form>
<apex:detail relatedList="false"/>
<apex:relatedList list="Contacts" />
<apex:relatedList list="Opportunities"/>
</apex:page>