Skip to content

Commit 6c33467

Browse files
authored
v1.7.21 - Update Rollup Layout (#712)
* Fixes issue with date literals that end with colons and spaces when they're the last part of a where clause * Correctly adds text-based override for Ultimate Lookup rollup field to Rollup__mdt layout
1 parent 80020fe commit 6c33467

File tree

10 files changed

+46
-21
lines changed

10 files changed

+46
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co
2424

2525
## Deployment & Setup
2626

27-
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000sy9dIAA">
27+
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000syA7IAI">
2828
<img alt="Deploy to Salesforce" src="./media/deploy-package-to-prod.png">
2929
</a>
3030

31-
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000sy9dIAA">
31+
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000syA7IAI">
3232
<img alt="Deploy to Salesforce Sandbox" src="./media/deploy-package-to-sandbox.png">
3333
</a>
3434
<br/>

extra-tests/classes/RollupEvaluatorTests.cls

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,28 @@ private class RollupEvaluatorTests {
12991299
System.assertEquals(true, eval.matches(new ContactPointConsent(Name = '0-Current')));
13001300
}
13011301

1302+
@IsTest
1303+
static void whereClauseThatEndsWithColonDelimitedDateLiteralShouldWorkSpaces() {
1304+
String whereClause = 'ActivityDate >= TODAY AND ActivityDate <= NEXT_N_DAYS: 30';
1305+
1306+
RollupEvaluator.WhereFieldEvaluator eval = new RollupEvaluator.WhereFieldEvaluator(whereClause, Task.SObjectType);
1307+
1308+
System.assertEquals(true, eval.matches(new Task(ActivityDate = System.today())));
1309+
System.assertEquals(true, eval.matches(new Task(ActivityDate = System.today().addDays(30))));
1310+
System.assertEquals(false, eval.matches(new Task(ActivityDate = System.today().addDays(31))));
1311+
}
1312+
1313+
@IsTest
1314+
static void whereClauseThatEndsWithColonDelimitedDateLiteralShouldWorkNoSpaces() {
1315+
String whereClause = 'ActivityDate >= TODAY AND ActivityDate <= NEXT_N_DAYS:30';
1316+
1317+
RollupEvaluator.WhereFieldEvaluator eval = new RollupEvaluator.WhereFieldEvaluator(whereClause, Task.SObjectType);
1318+
1319+
System.assertEquals(true, eval.matches(new Task(ActivityDate = System.today())));
1320+
System.assertEquals(true, eval.matches(new Task(ActivityDate = System.today().addDays(30))));
1321+
System.assertEquals(false, eval.matches(new Task(ActivityDate = System.today().addDays(31))));
1322+
}
1323+
13021324
private static String getSoqlCompliantDatetime(Datetime dt) {
13031325
return dt.format('yyyy-MM-dd\'T\'HH:mm:ssZ');
13041326
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apex-rollup",
3-
"version": "1.7.20",
3+
"version": "1.7.21",
44
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
55
"repository": {
66
"type": "git",

rollup-namespaced/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ For more info, see the base `README`.
1818

1919
## Deployment & Setup
2020

21-
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000sy9iIAA">
21+
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000syACIAY">
2222
<img alt="Deploy to Salesforce"
2323
src="./media/deploy-package-to-prod.png">
2424
</a>
2525

26-
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000sy9iIAA">
26+
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKf000000syACIAY">
2727
<img alt="Deploy to Salesforce Sandbox"
2828
src="./media/deploy-package-to-sandbox.png">
2929
</a>

rollup-namespaced/sfdx-project.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"default": true,
55
"package": "apex-rollup-namespaced",
66
"path": "rollup-namespaced/source/rollup",
7-
"versionName": "Fixes issue with invalid field names false positive errors when using rollups started from parent in conjunction with Rollup__mdt-based Flow rollups",
8-
"versionNumber": "1.2.17.0",
7+
"versionName": "Fixes issue with where clauses that end with colon-delimited date literals",
8+
"versionNumber": "1.2.18.0",
99
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
1010
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
1111
"unpackagedMetadata": {
@@ -34,6 +34,7 @@
3434
"[email protected]": "04tKf000000sy43IAA",
3535
"[email protected]": "04tKf000000sy4DIAQ",
3636
"[email protected]": "04tKf000000sy4cIAA",
37-
"[email protected]": "04tKf000000sy9iIAA"
37+
"[email protected]": "04tKf000000sy9iIAA",
38+
"[email protected]": "04tKf000000syACIAY"
3839
}
3940
}

rollup/core/classes/RollupEvaluator.cls

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ public without sharing abstract class RollupEvaluator implements Rollup.Evaluato
393393
}
394394
}
395395
String value = words[++index];
396+
if (value.endsWith(':') && index == words.size() - 2) {
397+
value += ' ' + words[++index];
398+
}
396399
if (criteria.endsWithIgnoreCase('in') || criteria.endsWithIgnoreCase('includes')) {
397400
while (value.endsWith(')') == false) {
398401
String nextWord = words[++index];

rollup/core/classes/RollupLogger.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
global without sharing virtual class RollupLogger implements ILogger {
33
@TestVisible
44
// this gets updated via the pipeline as the version number gets incremented
5-
private static final String CURRENT_VERSION_NUMBER = 'v1.7.20';
5+
private static final String CURRENT_VERSION_NUMBER = 'v1.7.21';
66
private static final System.LoggingLevel FALLBACK_LOGGING_LEVEL = System.LoggingLevel.DEBUG;
77
private static final RollupPlugin PLUGIN = new RollupPlugin();
88

rollup/core/layouts/Rollup__mdt-Rollup Layout.layout-meta.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@
194194
<behavior>Edit</behavior>
195195
<field>UltimateParentLookup__c</field>
196196
</layoutItems>
197+
<layoutItems>
198+
<behavior>Edit</behavior>
199+
<field>UltimateParentLookupText__c</field>
200+
</layoutItems>
197201
<layoutItems>
198202
<behavior>Edit</behavior>
199203
<field>ConcatDelimiter__c</field>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
33
<fullName>UltimateParentLookupText__c</fullName>
44
<description>Text alternative for Ultimate Parent Lookup field for optimized CMDT queries</description>
55
<externalId>false</externalId>
66
<fieldManageability>DeveloperControlled</fieldManageability>
7-
<inlineHelpText>Text alternative for Ultimate Parent Lookup field for optimized CMDT queries</inlineHelpText>
7+
<inlineHelpText>Text alternative for Ultimate Parent Lookup field for optimized CMDT queries. Only this OR the lookup field should be set</inlineHelpText>
88
<label>Ultimate Parent Lookup (Text)</label>
99
<length>255</length>
1010
<required>false</required>
1111
<type>Text</type>
1212
<unique>false</unique>
13-
</CustomField>
13+
</CustomField>

sfdx-project.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"package": "apex-rollup",
66
"path": "rollup",
77
"scopeProfiles": true,
8-
"versionName": "Fixes issue with invalid field names false positive errors when using rollups started from parent in conjunction with Rollup__mdt-based Flow rollups",
9-
"versionNumber": "1.7.20.0",
8+
"versionName": "Fixes issue with where clauses that end with colon-delimited date literals",
9+
"versionNumber": "1.7.21.0",
1010
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
1111
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
1212
"unpackagedMetadata": {
@@ -103,17 +103,12 @@
103103
"Apex Rollup - Rollup [email protected]": "04t6g000008Sis0AAC",
104104
"Nebula Logger - [email protected]": "04t5Y0000015oRNQAY",
105105
"apex-rollup": "0Ho6g000000TNcOCAW",
106-
"[email protected]": "04t6g000008OfsPAAS",
107-
"[email protected]": "04t6g000008OftNAAS",
108-
"[email protected]": "04t6g000008OfuLAAS",
109-
"[email protected]": "04tKf000000sxuWIAQ",
110-
"[email protected]": "04tKf000000sxvFIAQ",
111-
"[email protected]": "04tKf000000sxxzIAA",
112106
"[email protected]": "04tKf000000sy3ZIAQ",
113107
"[email protected]": "04tKf000000sy3oIAA",
114108
"[email protected]": "04tKf000000sy3yIAA",
115109
"[email protected]": "04tKf000000sy48IAA",
116110
"[email protected]": "04tKf000000sy4SIAQ",
117-
"[email protected]": "04tKf000000sy9dIAA"
111+
"[email protected]": "04tKf000000sy9dIAA",
112+
"[email protected]": "04tKf000000syA7IAI"
118113
}
119114
}

0 commit comments

Comments
 (0)