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
info4jf-forceinfo4jf-force 

How to show error message on record during list-based editing

When you enable editing through a list controller, how do you get any on-save error messages to be displayed only on the record(s) that have an error? The <apex:message> and <apex:messages> tags do not appear to work within a <apex:pageBlockTable> tag for this purpose.

I have only been able to get an error message to show up at the top of the page, or on every single record displayed (it is displayed for both the record that caused the error and all others).

Unless there is a solution, then editing in lists is essentially unusable, because there's no way to provide a user with feedback about which specific row triggered an error. 

This is related to the following two pages of documentation.

Visualforce Developer's Guide, version 24.0
> Standard List Controllers > Editing Records with List Controllers (http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_edit_data.htm)
> Advanced Examples > Mass-Updating Records with a Custom List Controller (http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_massupdate.htm)

Also, it is related to the Force.com Discussion Board posting at http://boards.developerforce.com/t5/Visualforce-Development/How-to-show-Error-message-near-an-inputField-using-custom/td-p/88078.

Saravanan @CreationSaravanan @Creation

Hi Jon Freed.

 

I think we can't able to display the error message instead we can display only the error record in list view.For this to achieve we can use Database.insert() method .

 

Go through this link it will help you

 

http://blog.jeffdouglas.com/2009/11/02/using-saleforce-dml-statements-or-dml-database-methods/

info4jf-forceinfo4jf-force

Thank you for your response, but it does not answer my question, as far as I can tell.

 

You actually are able to display the error message, but you are not able to display it next to or on just the specific record that caused it (as far as I can tell). Instead, you can display the message at the top of the page, or you can display the message on every single record (even the ones that didn't cause the error).

 

It's hard to believe that Salesforce doesn't have better grid-based editing for sets of records. Other solutions, e.g. Siebel, had it in web pages many years ago. For all of its power, Salesforce is still very web 1.0 versus web 2.0, with its limitations on what you can edit without going to an Edit page for one specific record. Sure, we could create a lot of custom Apex and VisualForce to do better grid-based editing, but that much development shouldn't be necessary. (Okay, I'll get off my soapbox now.)