0

We want to override the "New" button for a custom object for our community, using a Lightning Component.
So we went ahead and did that. The thing is, now the "New" button doesn't appear on the related list for this object.
I'm not getting any Aura errors or anything. In the page layout for the parent object the "New" button is set to show on the related list. But in actual practice of displaying the related list there is no button.

EDIT:
This is definitely a community issue, since for regular users the "New" button exists on the related list, and it launches my custom component.

Component code:

<aura:component implements="force:hasRecordId,lightning:actionOverride" access="global">

    <aura:registerEvent name="customEvent" type="c:customEvent"/>

    <lightning:recordEditForm objectApiName="MyObject__c"
            onload="{!c.handleLoad}" onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" onerror="{!c.handleError}">
        <lightning:messages />
        <div class="slds-p-around_small">
            <lightning:inputField fieldName="Name"/>
            <lightning:inputField fieldName="Field1__c"/>
            <lightning:inputField fieldName="Field2__c"/>
            <lightning:inputField fieldName="MasterDetail__c" value="{!v.recordId}"/>
            <div class="slds-m-top_medium">
                <lightning:button variant="brand" type="submit" name="save" label="Save" />
            </div>
        </div>
    </lightning:recordEditForm>

</aura:component>

Controller:

handleLoad : function(component, event, helper) {

},

handleSubmit: function(component, event, helper) {

},

handleSuccess: function(component, event, helper) {
    var fireEvent = $A.get("e.c:customEvent");
    fireEvent.fire();
},

handleError: function(component, event, helper, error){
}
0

Well, I heard back from Salesforce support.
Apparently this is a feature that is not available to communities. There's an Idea for that. Please go upvote it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.