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
uma52551.3972270309784705E12uma52551.3972270309784705E12 

How to set redirect in the controller class

Hi,

Please help me to correct my code below:

if(AssumptionList.size() > 0){
String strAssumptionFloodOnlyUrl = objArkCampaign.Domain_Name__c + '/Assumption?AssumptionId=' + AssumptionList[0].Assumption_ID__c;
PageReference newFloodOnlyUrl = new PageReference(strAssumptionFloodOnlyUrl);
newFloodOnlyUrl.setRedirect(true);
return;
}
According to the above code it has to redirect to another page(objArkCampaign.Domain_Name__c + '/Assumption?AssumptionId=' + AssumptionList[0].Assumption_ID__c) and display the content of this but it is not doing so. It is printing this page content in the old page itself( The Url in the address bar is also not changing)

Thanks in advance
Best Answer chosen by uma52551.3972270309784705E12
Ricky MartinRicky Martin
Hi,

return the newFloodOnlyUrl;

or else check the value of strAssumptionFloodOnlyUrl by using system.debug.