You need to sign in to do that
Don't have an account?
Visualforce error kindly help.
I have a custom object Cobject. It has some data in it. with the help of CobjectId, I am displaying the individual records in a visualforce page.This visualforce page has a custom controller. I am displaying records in the visualforce page with this url like https://cnp.na3.visual.force.com/apex/Cobjectdetail?id=a055000000AJDJT.
Its working well. But if I remove id value from the url(https://cnp.na3.visual.force.com/apex/Cobjectdetail?id=)
Its giving this error:
Visualforce Error
Id value is not valid for the TCObject__c standard controller.
How to handle this error. With out the CobjectId, it should redirect to custom object tab.
Please help me.
Thanks,
Naresh
Hi,
You will have to handle this issue in your controller.
Simply check to see if the param is null in your constructor, if null return error else continue with the further operations.
I don't believe you can force a page redirect from your controller directly, I think this requires an action originating on your page. The normal way to handle this would be to display an error on your page and provide a link back to the previous page.
I hope this helps,
Melvin!
If you are using standard controller without extension then you should pass id as a query string parameter otherwise it will show an error.
I am using extension. But still I am getting the error.
Thanks
Naresh
You should the id value to make sure its not null
ID idVal = ApexPages.currentPage().getParameters().get('id');
you need to check prior using it.
If (idVal != null)
{
//actual functioanlity here
}
else
//custom message