3

I have an object that has its Edit button overwritten in Classic using a VisualForce page. Works as designed. In Lightning that overwrite is obsolete and the normal edit will do just fine. I have only part of the users on Lightning yet, so I can’t remove the overwrite (unless I produce something that works in the console) and I only see the option to overwrite the button in Lightning by something else, but not “leave it as is”.

What do I miss? Or: how could I model: Edit is overwritten in Classic but standard in Lightning - with the constraint: must work in console too?

2
  • This is very interesting and I don't think you can actually not decide to use the VF page override until you really create a custom component! Not related but this reminds me of this idea. You may actually like to post an idea around the issue you highlighted here.
    – Jayant Das
    Commented Sep 13, 2018 at 12:39
  • And I posted this idea just now.
    – Jayant Das
    Commented Sep 13, 2018 at 12:52

2 Answers 2

3

As you have already discovered that there's no way not to use the Classic override in Lightning Experience, as there are only two options available there:

  1. Either use Classic Override

    OR

  2. Use Lightning Component

    enter image description here


It would actually have been a good option to have "No override (use default)" available for LEX same as available for Classic thus allowing what you wanted to achieve. And I have already posted an idea for this.

In absence of this, the simplest and least impactful for you not to use a VF page override is to create a Lightning Component using force:recordEdit. While this is still a customization but you get the standard edit page in this case with minimal customizations required. You will find more details on the documentation, but that may be your option as of today.

0

You can create an aura component that call the same action but with nooverride=1 (without override)

Component

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <lightning:navigation aura:id="navigation"/>
</aura:component>

Controller

    /**
     * Redirect to Record Edit Page without override
     */
    doInit : function(component, event, helper) {
        let recordId = component.get("v.recordId");
        console.log("### [RecordEditOverride] [RECORD ID] = " + recordId);
        component.find("navigation")
        .navigate({
            "type" : "standard__recordPage",
            "attributes": {
                "recordId"      : recordId,
                "actionName"    : "edit"
            },
            "state": {
                "nooverride": "1"
            }
        }, true);
    }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .