+ Start a Discussion

Error: The class 'java.lang.String' does not have the property 'name'.

I trying to create the Visualforce 'Create a wizard' but I'm getting an error when I try and save the 'opptyStep1' page. This error is as follows: 'Error: The class 'java.lang.String' does not have the property 'name' See example on http://www.salesforce.com/us/developer/docs/pages/index.htm
The error message should not includethe java.lang. prefix (already bugged) but the underlying issue is that you have a property getter method (public String getName() created by a quick fix I suspect - the quick fix to create an unknown property always picks String as the property type because it has no additional info available to do anything more sophisticated) in your controller that is returning a String and you are trying to use it like it is an sobject (e.g. Account or Contact) with something like {!account.name}.