+ Start a Discussion
Joseph DindingerJoseph Dindinger 

Object type not accessible on VisualForce "wrapper" page

Hello troubleshooters!

Really need your suggestions on how we can fix or get around this bug because it is something that has stumped our entire development team...

We have a VF page that we are using (in the Highlighter app) to replace the "view" for Leads.  Here are the most basic elements of the page:
 
<apex:page standardController="Lead" title="Lead: {!Lead.Name}" id="pg">
     <apex:Detail subject="{!$CurrentPage.parameters.Id}" relatedList="true" inLineEdit="true" relatedListHover="true" showChatter="true"  title="true" />
</apex:page>

The view is working great and if you edit through the "Edit" button it also works great.  But if you inline edit and try to save, then you get this horrible error:
 
Object type not accessible. Please check permissions and make sure the object is not in development mode: Salutation, FirstName, LastName, MiddleName, InformalName, Suffix ^ ERROR at Row:1:Column:51 No such column 'MiddleName' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.. Original queryString was: 'SELECT Id, Name, Salutation, FirstName, LastName, MiddleName, InformalName, Suffix FROM Lead WHERE id = ...

After much research, we now know that the error is completely wrong and what it really should say is that you have too many fields on the page for VisualForce to process.  See this article on this "feature":
 
https://help.salesforce.com/apex/HTViewSolution?id=000126972&language=en_US

We've verified that if you remove a few fields from my Lead layout, then you are able to get it to work.  It is only after an unknown limit that it starts to fail.  This is crazy!  Any help would be very appreciated...

Thank you,

Joseph
James LoghryJames Loghry
Joseph,

As far as the MiddleName error goes, you have to contact Salesforce support to have them enable the field.  See the "MiddleName" description here: http://help.salesforce.com/apex/HTViewHelpDoc?id=leads_fields.htm.  

It may not be the entirety of your issue, but it seems to be part of it at least.
Joseph DindingerJoseph Dindinger
Hi James,

Thank you and that is an interesting issue, but it does not solve the problem.  The error VisualForce is giving is misleading.  It actually has nothing to do with the MiddleName field.  You can solve this issue by removing a few fields from the page, until you get under the unpublished limit for fields on a VisualForce page.

This is obviously not a good solution for administrators who have toiled to get all of the fields on a page that are needed, and suddenly are hit with this limitation.

Any other suggestions?

Thank you!

Joseph