<turbo-stream action="update" target="wiki_card"><template>

<h1>Using Declarative Lookup Rollup Summaries (DLRS) in Salesforce</h1>
<div class="trix-content"><p><strong>Declarative Lookup Rollup Summaries (DLRS)</strong> is a free, open-source Salesforce tool that allows you to perform <strong>roll-up summary calculations on lookup relationships</strong>, something standard Salesforce does <strong>not support natively</strong>.This functionality works great in combination with the Rapidi custom objects ( Posted Sales Invoices, Posted Sales Credit Memos, Customer Ledger Entries, Sales Orders) which are provided as part of the <a href="https://wiki.myrapidi.com/wiki/standard_integrations">standard integration</a> package.&nbsp;<br><br>Use cases include:</p><ul><li>Summing revenue from child objects (e.g., Invoices) to parent objects (e.g., Account);</li><li>Calculating <strong>Year-To-Date (YTD)</strong> sales;</li><li>Summing <strong>Payments Received</strong> per customer.</li></ul><h3>Installation Instructions:</h3><ol><li>Go to the Salesforce AppExchange : <a href="https://github.com/afawcett/declarative-lookup-rollup-summaries">https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000B45gWEAR</a></li><li>Under <strong>Installation Options</strong>, choose:<ul><li><strong>Managed Package</strong> for most users (easy to upgrade and maintain);</li></ul></li><li>Install it in your <strong>sandbox</strong> first to test;</li><li>After installation, you will see a new app: <strong>Declarative Lookup Rollup Summaries </strong>under<strong> App Launcher.</strong></li></ol><h3>Key Components After Installation:</h3><ul><li><strong>Lookup Rollup Summaries Tab</strong>: Define and manage your rollups;</li><li><strong>Custom Metadata (Setup &gt; Custom Metadata Types &gt; Lookup Rollup Summary)</strong>: Advanced config view;</li><li><strong>Schedule Jobs</strong>: Configure scheduled or batch rollups.</li></ul><h3>Example: Rolling up Posted Invoice Totals to Account:</h3><p>Scenario:</p><p>You have a custom object <code>InvoiceHeader__c</code> (posted sales invoices) related to <code>Account</code> via a <strong>lookup field</strong> <code>Bill_to_Customer__c</code>. You want to:</p><ul><li>Sum the total amount invoiced <strong>in FY 2026 (Apr 2025 - Mar 2026)</strong> to <code>AnnualRevenue__c</code></li></ul><h3>Step-by-Step Configuration (using Metadata UI):</h3><p>1. Annual Revenue Rollup</p><ul><li><strong>Lookup Rollup Summary Name</strong>: Annual Revenue Rollup</li><li><strong>Parent Object</strong>: Account</li><li><strong>Child Object</strong>: InvoiceHeader__c</li><li><strong>Relationship Field</strong>: Bill_to_Customer__c</li><li><strong>Relationship Criteria</strong>:</li><li><pre><code>Posting_Date__c &gt;= 2025-04-01 AND Posting_Date__c &lt;= 2026-03-31 AND Document_Type__c = 'Invoice'</code></pre></li><li><strong>Field to Aggregate</strong>: Total_Amount_incl_VAT__c</li><li><strong>Aggregate Operation</strong>: SUM</li><li><strong>Aggregate Result Field</strong>: AnnualRevenue__c</li><li><strong>Calculation Mode</strong>: Scheduled</li><li><strong>Calculation Sharing Mode</strong>: System</li><li><strong>Active</strong>: Checked</li></ul><p><br><br></p><p></p><figure class="attachment attachment--preview attachment--png"><img src="/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBdXdEIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bc5d169950fb0d782b3e360cb682bf52d176cbd2/Declarative%20Lookup%20Rollup%20Summary%20Annual%20Revenue.png" width="800" height="310"><figcaption class="attachment__caption"></figcaption></figure><br><br><br><br><br><p></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><h3>Running the Rollups:</h3><ul><li>Go to the <strong>DLRS App &gt; Schedule Jobs</strong></li><li>Click <strong>Schedule All</strong> to enable background calculation</li><li>Or click <strong>"Full Calculate"</strong> to run immediately per rollup</li></ul><h3>Limitations &amp; Tips:</h3><ul><li>You can't use dynamic TODAY() in filter logic directly. For fiscal year logic, create a formula field like <code>Fiscal_Year__c</code>.</li><li>If data volume is large, always use <strong>Scheduled</strong> mode</li><li>Avoid activating Realtime mode unless trigger management is fully set up</li></ul><p><br>DLRS extends Salesforce with the ability to perform rollups on any relationship. It's essential for integration-heavy orgs, custom ERP syncs, and fiscal reporting where flexibility and filters are key.</p><p>With DLRS + simple criteria like <code>Document_Type__c = 'Invoice'</code> and fiscal date filters, you can automate year-based revenue reporting without writing a single line of code.</p></div>
</template></turbo-stream>

