You need to sign in to do that
Don't have an account?
krishna chaitanya 35
Need help in lightning how to override standard new page in opportunity with visualforce page
Hi All,
I have an requirement to override standard salesforce page with visualforce page in "New" button for opportunity ,it is working in salesforce classic as expected but the same is not working in lightning experience.can any one help me on this how to re-direct in lightning salesforce.
My code:
Page:
<apex:page standardController="Opportunity" extensions="MyController" action="{!redirect}"> </apex:page>
Controller:
public with sharing class MyController{
public MyController(ApexPages.StandardController controller) {
}
public PageReference redirect() {
PageReference pr = new PageReference('/006/e');
pr.getParameters().put('retURL',ApexPages.currentPage().getparameters().get('retURL'));
pr.getParameters().put('ent',ApexPages.currentPage().getparameters().get('ent'));
pr.getParameters().put('nooverride','1');
pr.getParameters().put('opp3', 'Name_Opco_Product');
return pr;
}
}
Thanks in advance,
Krishna.
I have an requirement to override standard salesforce page with visualforce page in "New" button for opportunity ,it is working in salesforce classic as expected but the same is not working in lightning experience.can any one help me on this how to re-direct in lightning salesforce.
My code:
Page:
<apex:page standardController="Opportunity" extensions="MyController" action="{!redirect}"> </apex:page>
Controller:
public with sharing class MyController{
public MyController(ApexPages.StandardController controller) {
}
public PageReference redirect() {
PageReference pr = new PageReference('/006/e');
pr.getParameters().put('retURL',ApexPages.currentPage().getparameters().get('retURL'));
pr.getParameters().put('ent',ApexPages.currentPage().getparameters().get('ent'));
pr.getParameters().put('nooverride','1');
pr.getParameters().put('opp3', 'Name_Opco_Product');
return pr;
}
}
Thanks in advance,
Krishna.
Please refer below links for that.
https://trailhead.salesforce.com/en/lex_dev_visualforce/lex_dev_visualforce_multipurpose_pages
https://trailhead.salesforce.com/en/lex_dev_visualforce/lex_dev_visualforce_intro
Hope this helps you!
Thanks and Regards
Sandhya
Thank you for the links.But in the links i didnt find any example or sample code for over riding the standard pages.If you have any sample reference please provide me.
Thanks,
Krishna.
To use the override standard button with the Visualforce page in the Lightning experience. You have to check which user interface is running currently. Below is sample code. This page will work in both Salesforce Classic as well as Lightning Experience user interface.
Hope this will help you as well as others who are looking for the same.
Thanks
Arun Kumar