You need to sign in to do that
Don't have an account?
thornton
VisualForce Login Abstraction Model
I have a easy question re abstraction of logic.
I have a VisualForcePage that needs to read an ID from the URL, lookup that data and autoredirect to the URL found in a custom Object returned by a query.
I understand that the redirect will be in javascript using the window.Location="someurl";
How do I read the URl coming from the page if defined and do the lookup?
Hi,
String recordId =ApexPages.currentPage().getParameters().get('id');
Your_Object__c obj = [Select Id, URL__c FROM Your_Object__c WHERE Id=: recordId];
PageReference pageRef = new PageReference(obj.URL__c);
return pageRef; // this will redirect the user to the URL found in the custom Object
Regards,
Arun.
You can read any property X from URL as below
String y = apexpages.currentpage().getparameters().get('X') ;
now if you want to read id from URL put id in place of X