You need to sign in to do that
Don't have an account?
AxxxV
I have a VF page for a standard object that uses standard controller and a controller extension. When an invalid object Id is passed, or record is unavailable (deleted or due to permissions), the standard controller throws the "hard-error" and the error is displayed in the standard SFDC UI (with the sidebar and header). My application has a completely cusom UI and I do not want to be "thrown" into the standard SFDC UI in case of an error. I tried to trap the error in the extension controller class, but it looks like standard controller traps it first and does not allow me to put in place any custom error handling.
Any suggestions?
Getting around Standard Controller Exception Handling
I have a VF page for a standard object that uses standard controller and a controller extension. When an invalid object Id is passed, or record is unavailable (deleted or due to permissions), the standard controller throws the "hard-error" and the error is displayed in the standard SFDC UI (with the sidebar and header). My application has a completely cusom UI and I do not want to be "thrown" into the standard SFDC UI in case of an error. I tried to trap the error in the extension controller class, but it looks like standard controller traps it first and does not allow me to put in place any custom error handling.
Any suggestions?
Hi,
I have an idea....
Don't use a standardController and an extension. Use just a custom controller and get the data there. Then put the SOQL in a try-catch block.
True, but there are always more than one way to skin a cat... :smileywink:
I had a similar issue before where I wanted to add a VisualForce page to the object's layouts, this is how I did it.
and this was my controller:
Now, make sure the data you display is read from the extension and not from the standard controller.
Did this solution work for anyone?
As far as I recall I had tried this. But if an invalid Id is passed to the page, the standard controller will throw an error before the
statement is even reached and consequently, the hard error is thrown before you get a chance to trap it...
I just tried this solution and it does not work. Does anyone have any other ideas for this?