I want to display the add product to opportunity price book page(/p/opp/SelectSearch) in lightning. We override the opportunity edit screen with VF and then redirect to this page:
PageReference returnURL = new PageReference('/p/opp/SelectSearch');
returnURL.getParameters().put('addTo', upsertedOpportunity.id);
List<OpportunityLineItem> oppProducts = [Select ID , OpportunityId From OpportunityLineItem where id=:upsertedOpportunity.id];
Id oppProductDetailPageID=null;
if(oppProducts!=null && oppProducts.size()>0){
oppProductDetailPageID = oppProducts[0].id;
returnURL.getParameters().put('retURL', '/'+oppProductDetailPageID);
}
//returnURL.getParameters().put('retURL', '/apex/SPW_OpportunityView'+upsertedOpportunity.id+'/nooverride=1');
return returnURL;
If you are in lightning then it displays the vf styled as lightning but then after the redirect Salesforce switches to classic, then after you add a product it switches you back to lightning. Is there no way to keep this page in lightning?
I suspect lightning isn't supported because when you try to override the add product page there is no option for overriding with a lightning component:
ANY info would be greatly appreciated. Here is another post that almost exactly matches my problem.