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
Becky Miller 15Becky Miller 15 

Page Reference Classic to Lightning

This is our old Page Reference for the Classic: It is creating a new Quote Page and updating certain fields:
PageReference pref =  new PageReference('lightning/0Q0/e?Name=' + EncodingUtil.urlEncode(theOpp.Name,'UTF-8')  + '&retURL=%2F' + theOpp.id + '&oppid=' + theOpp.Oppty_ID_18__c);

This is our new Page Reference for the Lightning.  It is not populating the Quote Name with Opportunity Name, Opportunity, Account Name.
           
PageReference pref = new PageReference('/lightning/o/Quote/new?Name=' +theOpp.Name+'&retURL=%2F'+ '&oppid=' + theOpp.Oppty_ID_18__c);


Any guidance someone could provide me that would be great.
VinayVinay (Salesforce Developers) 
Hi Becky,  

Can you try below
PageReference pref = new PageReference('/' +theOpp.Name+'&retURL=%2F'+ '&oppid=' + theOpp.Oppty_ID_18__c);

https://salesforce.stackexchange.com/questions/173802/page-reference-not-redirecting-properly

Thanks,
Becky Miller 15Becky Miller 15

This is what I get when I tried your suggestion.  

URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com.

You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates

If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.

If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.

If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!