Hiding the Opportunity Pipeline Statistics using the Client Side API

1 minute read time.

The default Pipeline within the Opportunity List displays a Statistics panel beneath the pipeline.

The article Customizing the Opportunity Pipeline Summary Information explains how to control the information in the Pipeline statistics area but not actually how to hide it.

This can be done using the Client Side API.  If the source HTML of the page is shown you can see that there are classes and tag ID values that can be used to identify the elements on the page.

<tr><td><table><tbody><tr><td class="PIPE_SUMMARY_HEADER">Statistics for all stages</td></tr></tbody></table><table class="PIPE_SUMMARY" id="PIPE_SUMMARY" name="PIPE_SUMMARY" width="100%" style="width: 100%;"><tbody><tr><td valign="TOP"><span id="_CaptQry_Count" class="VIEWBOXCAPTION">Number of opportunities:</span> <span id="_DataQry_Count" class="VIEWBOX" style="WIDTH:100px;">7</span></td><td valign="TOP"><span id="_CaptQry_SumForeCast" class="VIEWBOXCAPTION">Forecast:</span> <span id="_DataQry_SumForeCast" class="VIEWBOX">USD 680,746.25</span></td><td valign="TOP"><span id="_CaptQry_WeightedForecast" class="VIEWBOXCAPTION">Weighted forecast:</span> <span id="_DataQry_WeightedForecast" class="VIEWBOX">USD 234,100.22</span></td></tr><tr><td valign="TOP"><span id="_CaptQry_AvgDealValue" class="VIEWBOXCAPTION">Average value:</span> <span id="_DataQry_AvgDealValue" class="VIEWBOX">USD 97,249.46</span></td><td valign="TOP"><span id="_CaptQry_AvgCertainty" class="VIEWBOXCAPTION">Average certainty:</span> <span id="_DataQry_AvgCertainty" class="VIEWBOX" style="WIDTH:100px;">53.57%</span></td><td valign="TOP"><span id="_CaptQry_AvgWeighted" class="VIEWBOXCAPTION">Weighted average:</span> <span id="_DataQry_AvgWeighted" class="VIEWBOX">USD 52,097.93</span></td></tr></tbody></table></td></tr>

The classes and ids can be used in JavaScript but in this case we need to hide the panel from the initial <tr> tag. that starts the block that contains the pipeline summary.

We can target the parent <tr> by working up from a known ID or class. Since the table has an ID of PIPE_SUMMARY, we can use that to find the containing <tr>.

crm.ready(function () {
  var summaryTable = document.getElementById("PIPE_SUMMARY");
  if (summaryTable) {
    var trElement = summaryTable.closest("tr");
    if (trElement) {
      trElement.style.display = "none";
    }
  }
});

The code can be added to the custom content box of the OpportunityList.

The crm.ready(...) ensures the code runs only after the CRM page has fully loaded.

The document.getElementById("PIPE_SUMMARY") locates the statistics table and .closest("tr") walks up the DOM tree to the <tr> element containing the entire section.  The style.display = "none" hides it from view.