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
ajay varmaajay varma 

Override View Button in Lightning Winter 17

Salesforce removed support for nooverride =1 in Lightning for winter 17, which is causing a recursive loop whenever I try to navigate to Standard object(Account) from Search List view. Its entering Loop as I've overriden View Button to point to VisualForce page.
 (I've created a Visualforce page that has an extension controller that returns a page reference to point to a URL).
I've tried sforce.one.NavigateToSobject, NavigateToUrl and all other navigation methods, but the problems is Lightning is not accepting
Nooverride as parameter in Winter 17 (Everything works fine in Summer 16)

It would be helpful if anyone can point me in right direction for Winter 17.

 
NagendraNagendra (Salesforce Developers) 
Hi Ajay,

We have overriden the Standard 'view' action on the Opportunity Object.

We have two different Record types - Type A and Type B. 

Type A - navigates to Custom visualforce page
Type B - Navigates to Standard page.

To achieve this we have used "Nooverride" parameter. See code below.
if (c.recordtypeid == recordTypeId[0].id) {
               
            newPage = Page.CustomVFPage;
        } else {
            newPage = new PageReference('/' + c.id +  '?nooverride=1');
            newPage.getParameters().put('nooverride', '1');
        }
Please mark this as best answer if it helps.

Best Regards,
Nagendra.P

 
ajay varmaajay varma
Salesforce removed support for Nooverride =1 in winter 17 for Lightning. I've tried above code as well and it loops continously without displaying page.

All I did was:
Step 01: Override Account View Standard Action with VF page (example: vf1 with controller extension vfexten)
step 2: vfexten has an action method that returns pagereference and based on logic I'm returning
            
                       if(something == true)
                           pagereference p = new pagereference('/' + accound.Id);
                           p.getparameters().put('nooverride',1);
                           p.setredirect(true);

                     return p;

Above code does work till summer 16 and does not work in winter 17. Upon checking Salesforce removed support for nooveride=1.
Which is fine, I need an alternative to achieve above url redirection based on overriding View button of standard object


Regards,
Ajay
 
Naveen MosuruNaveen Mosuru
If it is removed by Salesforce, then there will be a reason for this and I think the reason is providing this feature with a lightning:actionOverride interface to a Lightning component. Add this interface to a Lightning component to enable the component to be used to override a standard action on an object. Through this, we can override the View, New, Edit, and Tab standard actions.
Overriding an action with Lightning component is like overriding an action with a Visualforce page. It depends on the requirement which does you want to prefer because in Lightning Visualforce page is not accepted for overriding an action.

Refer to this link for further details https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_lex_s1_action_overrides.htm (http:// https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_lex_s1_action_overrides.htm)

https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_lightning_action_overrides.htm
Best Regards,
Naveen