Skip to content

Commit

Permalink
V1.5.24 - The Solo Admin Special (#366)
Browse files Browse the repository at this point in the history
* Further optimizations for full recalc rollup code paths by removing an intermediate inner class
* Fixes issue reported by @solo-1234 where re-submitting a full recalc job for CMDT would improperly format the Rollup Order By CMDT records
* Fixes issue reported by @solo-1234 where audit fields were causing RollupCalcItemReplacer to error out
  • Loading branch information
jamessimone authored Sep 30, 2022
1 parent 31888ff commit e8e6ac7
Show file tree
Hide file tree
Showing 11 changed files with 250 additions and 197 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ As well, don't miss [the Wiki](../../wiki), which includes more advanced informa

## Deployment & Setup

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008b0YSAAY">
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008b0Z6AAI">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008b0YSAAY">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008b0Z6AAI">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
Expand Down
15 changes: 15 additions & 0 deletions extra-tests/classes/RollupCalcItemReplacerTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,19 @@ private class RollupCalcItemReplacerTests {

System.assertEquals(ACC_ANNUAL_REVENUE, acc.AnnualRevenue);
}

@IsTest
static void skipsNonUpdateableFields() {
Account acc = [SELECT Id, CreatedDate FROM Account];

RollupCalcItemReplacer replacer = new RollupCalcItemReplacer(
new RollupControl__mdt(IsRollupLoggingEnabled__c = true, ReplaceCalcItemsAsyncWhenOverCount__c = 1)
);
Account updatedAccount = (Account) replacer.replace(
new List<Account>{ new Account(Id = acc.Id) },
new List<Rollup__mdt>{ new Rollup__mdt(CalcItemWhereClause__c = 'CreatedDate != null') }
)[0];

System.assertEquals(acc.CreatedDate, updatedAccount.CreatedDate);
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<?xml version="1.0" encoding="UTF-8" ?>
<CustomMetadata
xmlns="http://soap.sforce.com/2006/04/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<label>RollupIntegrationChildRollupText</label>
<protected>false</protected>
<values>
<field>CalcItemWhereClause__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>CalcItem__c</field>
<value xsi:type="xsd:string">RollupChild__c</value>
</values>
<values>
<field>ChangedFieldsOnCalcItem__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>ConcatDelimiter__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>FullRecalculationDefaultNumberValue__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>FullRecalculationDefaultStringValue__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>GrandparentRelationshipFieldPath__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
<values>
<field>IsFullRecordSet__c</field>
Expand All @@ -50,10 +54,6 @@
<field>LookupObject__c</field>
<value xsi:type="xsd:string">RollupParent__c</value>
</values>
<values>
<field>OrderByFirstLast__c</field>
<value xsi:type="xsd:string">TextField__c</value>
</values>
<values>
<field>RollupControl__c</field>
<value xsi:type="xsd:string">Org_Defaults</value>
Expand All @@ -76,6 +76,6 @@
</values>
<values>
<field>UltimateParentLookup__c</field>
<value xsi:nil="true"/>
<value xsi:nil="true" />
</values>
</CustomMetadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomMetadata
xmlns="http://soap.sforce.com/2006/04/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<label>Integration TextValue FIRST</label>
<protected>false</protected>
<values>
<field>FieldName__c</field>
<value xsi:type="xsd:string">TextField__c</value>
</values>
<values>
<field>NullSortOrder__c</field>
<value xsi:type="xsd:string">NULLS FIRST</value>
</values>
<values>
<field>Ranking__c</field>
<value xsi:type="xsd:double">0.0</value>
</values>
<values>
<field>Rollup__c</field>
<value xsi:type="xsd:string">RollupIntegrationChildRollupText</value>
</values>
<values>
<field>SortOrder__c</field>
<value xsi:type="xsd:string">Ascending</value>
</values>
</CustomMetadata>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
"version": "1.5.23",
"version": "1.5.24",
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit e8e6ac7

Please sign in to comment.