3

I was trying to change the label of the "new" standard button in communities to like "new affiliator". I tried creating some custom buttons just like the one for salesforce classic but they are not showing up on the object list view.

new button label

I tried using "create record button" in community builder but no success because the object is the child of the master-detail relationship with another object.

Any suggestion for changing the label? do i need to create a custom lightning component? if so, any advice how to do it?

2 Answers 2

1

I think whatever you are trying to achieve here is a limitation of the platform .

You cannot rename the labels of the standard actions .

You can add a global action to create a record via the component "Create Record Button" but you will need to change relationship to lookup .

Also note that it is the list view of the record and hence its not feasible to use Lightning Actions as well and only workaround is to use visualforce page list buttons .

You can open an idea on the idea exchange and have the community vote but definitely there is not much you can do without complete custom approach of throwing your own list component .

14
  • yes i have tested you can hide the new button. Under the Search Layout>>Object List View, untick the standard button "New" and it won't appear in the lightning page of my community. Commented Dec 5, 2016 at 2:07
  • if I am going to create a lightning component, any suggestion or example how to write the codes that can replace the standard button? I have googled around but haven't seen it yet Commented Dec 5, 2016 at 2:09
  • Ah just verified . Interesting that search layouts control them but you might end up hiding it from regular users as well and not just community users. Commented Dec 5, 2016 at 2:09
  • yup, if it is hidden from all the users, and I have created a button which did the same thing, i think it is acceptable Commented Dec 5, 2016 at 2:11
  • 1
    You can use the visualforce instead .See my updated answer .You will create a VF button and may be a onload script that redirects to create page . Commented Dec 5, 2016 at 3:08
0

So eventually I have created a lightning component which replace the standard button and add it into the community builder. Note: hide the standard button in search layout before dragging this button into the community builder object's list view.

in my component

<aura:component implements="forceCommunity:availableForAllPageTypes>
    <ui:button label="CustomButton" press="{!c.createRecord}"/>
</aura:component>

in my component's controller

({
    createRecord : function(component, event, helper) {
        var createRecordEvent = $A.get("e.force:createRecord");
        createRecordEvent.setParams({
            "entityApiName" : "CustomObjectAPI__c"
        });
        createRecordEvent.fire();
    }
})

in the css just makes it position to the right and it will look like the standard button has been replaced.

.THIS{
 YOUR CSS

}

You must log in to answer this question.

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