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
Brendan ConniffBrendan Conniff 

Inline editing error: “Value cannot exceed 0 characters”

I'm experiencing a strange error with Salesforce's Inline Editing in a custom visualforce page. I have a sObject with a date field called Start_Date__c, and I have inline editing set up in the VisualForce like this:
<apex:page standardController="Product_Assignment__c"
    tabStyle="Product_Assignment__c"
    extensions="TestInlineEditControllerExt">

<apex:form id="productForm">
    <apex:pageBlock >
        <apex:pageMessages />
        <apex:pageBlockTable value="{!productAssignments}" var="productAssignment">
            <apex:column headerClass="h1">
                <apex:facet name="header">Start Date</apex:facet>
                <apex:outputField value="{!productAssignment.Start_Date__c}">
                    <apex:inlineEditSupport changedStyleClass="dirtyField" event="ondblclick" showOnEdit="saveChanges" />
                </apex:outputField>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
    <apex:commandButton id="saveChanges" reRender="productForm" action="{!quicksave}" value="Save Changes" styleClass="saveChangesButton" />
</apex:form>
</apex:page>
The custom controller is (this is not my exact code, but it's enough to replicate the issue):
public with sharing class TestInlineEditControllerExt {
    public List<Product_Assignment__c> productAssignments { get; set; }

    public TestInlineEditControllerExt(ApexPages.StandardController stdController) {
        stdController.addFields(new List<String> { 'Start_Date__c' });
        productAssignments = new List<Product_Assignment__c> {
            (Product_Assignment__c)stdController.getRecord()
        };
    }
}
This works well in normal use cases. If I edit the field an input a deliberately incorrect value (like 'abcdef'), and press save, I receive the expected error: Start Date: Invalid Date and Time.

After this, if I attempt to click the revert button and save again, I receive a cryptic error message: Start Date: Value cannot exceed 0 characters.

I've tried following this pattern on a standard detail page, but this issue only seems to happen on my custom visualforce page. I've also tried using a custom action (instead of "quicksave") on my controller, but have the same issue (error message, controller is never called). We do not have any validation rules in place for this field.

Does anybody know why this error is happening and how I can fix this issue? It seems to only happen when I have an inline editing component inside of an apex:pageBlockTable or apex:repeat element.
Shri RajShri Raj
Hello Brendan Conniff,

I'm facing the same problem and i dont have a solution for this. This happens when the end user enters some invalid data into a Date field. I have seached all over and none had an answer so far.
Can you please let me know what was the solution you have found and best approach of dealing with this problem?

The whole message is LOCKING the inline edit functionality on my custom VF Page. Please help.

Regards,
Srikanth