Update: After detailed discussion with OP, we realized that standard related list component is not firing refreshView
event if it is for custom object. More details in this question : Standard "Related List - Single" component fires refreshView event only in certain cases
Ok.The below solution is kind of a hack on the assumption that standard related list component shows toast after new child record is added or existing child record is deleted or existing child record is edited.
I created a simple custom component to show Opportunity amount and there is a standard related list component showing Opportunity products on the same page.
Here is the code:
OpportunityAmountComponent.cmp:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" controller="OpportunityAmountComponentController">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="oppAmount" type="String" default="0.00"/>
<aura:handler event="force:showToast" action="{!c.doInit}"/>
<ui:outputText value="{!v.oppAmount}" />
</aura:component>
OpportunityAmountComponentController.cls:
public class OpportunityAmountComponentController {
@AuraEnabled
public static String getOpportunityAmount(String oppId){
return String.valueOf([SELECT Amount FROM Opportunity WHERE Id=:oppId].Amount);
}
}
OpportunityAmountComponentController.js:
({
doInit : function(component, event, helper) {
debugger;
var action = component.get("c.getOpportunityAmount");
action.setParams({ oppId : component.get("v.recordId") });
action.setCallback(this, function(response) {
component.set('v.oppAmount',response.getReturnValue());
});
$A.enqueueAction(action);
}
})
Result:
Not all standard components are available in Community Builder as available in App Builder. It also depends on the type of page you are creating. Refer to below excerpt from the documentation:
The Components panel lists only components that are compatible with the selected page. For example, you can’t add the User Profile Detail component to the Home page.
As of now, it seems Related List - Single is not available in Community Builder. But let's say even if it was available, for your scenario you would have required to add it individually for every other object, which may not have been desirable.
Solution: So for your scenario where you want to remove just a particular related list, you have the option to do so using the page layout. Remember, the Related List component (either in App Builder or Community Builder) derives all the related objects to be displayed which are configured in the object's page layout.
To be able to remove a particular related list, just edit your Case page layout to remove that particular object which is assigned to the Community profiles and you should be all set. Refer to an example below.
Best Answer
Winter 18' has something called 'Related List Quick Links' standard component using which you can mouseover on specific related list and navigate to its record!
https://releasenotes.docs.salesforce.com/en-us/winter18/release-notes/rn_forcecom_lab_related_list_quick_links_comp.htm