• info4jf-force
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

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.

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.

I have a formula field that i want to display a hyperlink to a visualforce page if the value if the current userid is a member of a given queue.  What i want to do is something like this:


IF (

$User.Id IN [select Id,Name,Type,(select UserOrGroupId From GroupMembers) from Group where Type='Queue'], "some link if true",

"some link if false"

)

 

Is there any way to do something like this straight from a formula field without just going to a visualforce page that has that logic in the controller?

  • August 25, 2009
  • Like
  • 0
Hi,
 
I have made a Visualforce page and custom controller for mass adding Sales Team Members for  Opportunities.
I used a newly created list of 5 OpportunityTeamMember records(to be inserted) for iteratively dispalying 5 input sets as in the standard Add Sales Team Page.
 
I wish to have a validation rule which, when the "Save" button is clicked, should add an error message near the TeamRole field of the if it is null.
I tried by the code

Code:
<apex:pageBlockTable value="{!OpportunityTeamMemberList}" var="TeamMember">
..........................
<apex:column headerValue="Team Role">                                           
   <apex:inputField id="inputTeamRole" value="{!TeamMember.TeamMemberRole}" />
</apex:column>
............................
 </apex:pageBlockTable>

 
Code:
if(MyTeamMemberList[index].TeamMemberRole==null)
  
  {     
        
        MyTeamMemberList[index].TeamMemberRole.addError('You must enter a value'); 
        .........       
  }


Problem with this code is that, if the user skips the TeamRole for the second or third input row, the message shows near the Team Role input field in the FIRST input row.
 
How can I add an Error message near theTeam Role inputField of the REQUIRED input row?
Can I use ApexPages.addMessage to input component of the SPECIFIC input row?
 
Thanks in advance
Krishna