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
jhartjhart 

bug in Spring '09: intermittent "inputField can only be used with SObject fields" error

Starting in the Spring '09 release, one of our pages is throwing this error intermittently.  I've run across it randomly - attempts to reproduce it have failed, but I've seen it more than once - and our customers are reporting the same thing.

 

Here's the error:

 

error screenshot

 

 

 

This error is new in Spring '09.  We've never seen it before, despite the exact same code running.

 

My understanding is that this error should be thrown if <apex:inputField> is used for an Apex object instance var rather than for an SObject field.  As can been seen from the error msg itself, our accessor chain does in fact end with an SOBject field.  Maybe the fact that there are a couple accessors in the chain is the problem?  Hard to say, as the error only strikes randomly - the code works most of the time.

 

The relevant code bits are, on the page:

 

 

<apex:dataTable value="{!pendingPager.matchOne}" var="each">
...
<tr class="if nc nl"><td>First Name</td><td><apex:inputField value="{!each.addr.FirstName__c}"/></td></tr>

 

 

 

 and on the controller:

 

 

global class PagerPending extends PagerBase {
...
// inner class
global class Item {
public EmailAddr__c addr;
global EmailAddr__c getAddr() { return addr; }
}
}

 

 

 

 Salesforce - I've created support case 02472586 to track this issue.

Message Edited by jhart on 02-26-2009 10:15 AM
Best Answer chosen by Admin (Salesforce Developers) 
dchasmandchasman
Update: I have the fix queued up for next week's patch (too late for this week's .3 release).

All Answers

SuperfellSuperfell
I've seen this when the sobject itself is null (so addr in your example)
jhartjhart

Thanks Simon,

Would that behavior be new in Spring '09?

 

A couple things would argue against a bug in our codebase for this particular issue:

 

1.  We've never seen this error before Spring '09

2.  We've got hundreds of clients running the exact same code pre- and post- Spring '09, and it's just started to hit them

3.   It strikes randomly - when I first saw it I freaked out, but repeating the same sequence of actions could not bring the error screen back.  As a result I didn't report it then (last week) because I couldn't isolate it, but once it hit our customers orgs I felt like I had to post something.

 

I guess we'll see if any other apps/packages are getting this error, and if so perhaps they'll be able to provide a repeatable sequence of actions.

Message Edited by jhart on 02-26-2009 04:41 PM
dchasmandchasman

This is not correct behavior - actual data should not impact this and if it is then its a bug. This error basically means that the metadata proxy we should be using to resolve metadata like field information is not being used and instead the runtime result of actually getting the value of a property is being used instead.

 

Have you opened a case with support on this that I can hand a bug for my team on?

jhartjhart

Hi Doug,

 

The support case # is 02472586.

 

thanks!

john

 

TehNrdTehNrd
I can confirm this issue. Unfortunately it appears to be random and very difficult to reproduce. Sorry I'm not more help but if I figure anything out I will post here.
Message Edited by TehNrd on 02-26-2009 04:30 PM
TehNrdTehNrd
One thing I have notice similar to your code and mine is that it is a dataTable displaying an outputField that is in a wrapper class. Not sure if it's related, but worth noting.
Message Edited by TehNrd on 02-26-2009 04:31 PM
dchasmandchasman

John/Jason - can you confirm that this error always occurs when invoking an action (POST back to the server)?

 

This is related to a change in the way VF pages/components are cached in the app server and the root cause is something we are already very much focused on - nothing wrong with your implemetation and no modifications will be necessary on your end to address this. This is my top priority issue (already was for another symptom detected last week in house). Very hard to pin down the repro case for this which has accounted for the slow turn around time.

Message Edited by dchasman on 02-27-2009 09:25 AM
TehNrdTehNrd

dchasman wrote:

John/Jason - can you confirm that this error always occurs when invoking an action (POST back to the server)?

 


For me, yes. It is an apex:actionFunction that calls a method in my controller.

Message Edited by TehNrd on 02-27-2009 09:07 AM
jhartjhart
Yes, I've only seen in on post back as well.  The customer scenarios I've heard also happened on post.
Kirk F.ax361Kirk F.ax361
We see it as well.  I've seen it twice, out of about 200 renders of the page in question.
dchasmandchasman
Update: I have the fix queued up for next week's patch (too late for this week's .3 release).
This was selected as the best answer
jhartjhart
great news - thanks Doug!