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
AffinaquestAffinaquest 

Visualforce Error Validation

I have placed a custom button on the account page which calls a visualforce page.  At the top of the custom page is a form collecting data for a custom object.  Below the form I display a small heading using HTML to indicate that the data shown below the heading is the account data to which the new row will be linked.  I then use the <apex:detail/> statement to display the account from which the form was called.  Everything works fine when the page is displayed. Everything works fine when I fill in the data and a new record is created which is properly linked to the account.

 

However, I have a problem when the data does not pass the validation tests for the custom object.  For example, if I have a required field which is left blank during data entry and hit the save key, I get a page which displays my form with an error next to the field which should have been filled in just as I would have expected.  The HTML heading displays, but the <apex:detail/> command is totally ignored.

 

Any idea of what's going on?  Is there a way to make this work properly?

 

Thanks in advance for any assistance that you might be able to render.

Rajesh ShahRajesh Shah
Can you paste your code to give a better idea why the error might be coming?
AffinaquestAffinaquest
I've found that if I add the "subject" attribute to the apex:detail element and set the subject to the id parameter of the page, that the account properly displays.  This seems to me to be a bug in VF.