Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.36 - Patches RollupFlowBulkProcessor + Rollup Order By support #634

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co

## Deployment & Setup

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

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008OfKiAAK">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008OfMeAAK">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
Expand Down
12 changes: 6 additions & 6 deletions extra-tests/classes/CustomMetadataDrivenTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private class CustomMetadataDrivenTests {
// uses a combination of Rollup__mdt found in extra-tests/customMetadata AND extra-tests/triggers/RollupChildTrigger.trigger
RollupParent__c parent = [SELECT Id FROM RollupParent__c];
// uses FIRST with TextField__c as the Order By field, MAX for the NumberField__c
RollupChild__c childOne = new RollupChild__c(Name = 'Child one', TextField__c = 'a', RollupParent__c = parent.Id, NumberField__c = 3);
RollupChild__c childOne = new RollupChild__c(Name = 'Child one', TextField__c = 'a', RollupParent__c = parent.Id, NumberField__c = 2);
RollupChild__c childTwo = new RollupChild__c(Name = 'Child two', TextField__c = 'b', RollupParent__c = parent.Id, NumberField__c = 2);

Test.startTest();
Expand All @@ -34,8 +34,8 @@ private class CustomMetadataDrivenTests {
}
// uses a combination of Rollup__mdt found in extra-tests/customMetadata AND extra-tests/triggers/RollupChildTrigger.trigger
RollupParent__c parent = [SELECT Id FROM RollupParent__c];
// uses FIRST with TextField__c as the Order By field, MAX for the NumberField__c
RollupChild__c childOne = new RollupChild__c(Name = 'Child one', TextField__c = 'a', RollupParent__c = parent.Id, NumberField__c = 3);
// uses FIRST (with NumberField__c, TextField__c as the Order By fields), MAX for the NumberField__c
RollupChild__c childOne = new RollupChild__c(Name = 'Child one', TextField__c = 'a', RollupParent__c = parent.Id, NumberField__c = 1);
RollupChild__c childTwo = new RollupChild__c(Name = 'Child two', TextField__c = 'b', RollupParent__c = parent.Id, NumberField__c = 2);
insert new List<RollupChild__c>{ childOne, childTwo };

Expand All @@ -55,7 +55,7 @@ private class CustomMetadataDrivenTests {
// re-assert on both fields being correct now, just to be sure
parent = [SELECT Id, TextField__c, NumberField__c FROM RollupParent__c];
System.assertEquals(childTwo.NumberField__c, parent.NumberField__c);
System.assertEquals(childTwo.TextField__c, parent.TextField__c);
System.assertEquals(childOne.TextField__c, parent.TextField__c);
}

@IsTest
Expand Down Expand Up @@ -177,12 +177,12 @@ private class CustomMetadataDrivenTests {
RollupParent__c parent = [SELECT Id FROM RollupParent__c];

Test.startTest();
insertRollupChildrenAsync(parent.Id, 'a', 3);
insertRollupChildrenAsync(parent.Id, 'a', 1);
Test.stopTest();

parent = [SELECT Id, TextField__c, NumberField__c FROM RollupParent__c];
System.assertEquals('a', parent.TextField__c);
System.assertEquals(3, parent.NumberField__c);
System.assertEquals(2, parent.NumberField__c);
}

@Future
Expand Down
2 changes: 1 addition & 1 deletion extra-tests/classes/CustomMetadataDrivenTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
30 changes: 30 additions & 0 deletions extra-tests/classes/InvocableDrivenTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,34 @@ private class InvocableDrivenTests {
acc = [SELECT AnnualRevenue FROM Account WHERE Id = :acc.Id];
System.assertEquals(child.PreferenceRank, acc.AnnualRevenue);
}

@IsTest
static void orderBysRetainRanking() {
RollupParent__c parent = new RollupParent__c(Name = 'Parent');
insert parent;

RollupChild__c childOne = new RollupChild__c(
RollupParent__c = parent.Id,
NumberField__c = 1,
TextField__c = 'b',
Id = RollupTestUtils.createId(RollupChild__c.SObjectType)
);
RollupChild__c childTwo = new RollupChild__c(
RollupParent__c = parent.Id,
NumberField__c = 1,
TextField__c = 'a',
Id = RollupTestUtils.createId(RollupChild__c.SObjectType)
);

Flow.Interview flowInterview = new Flow.Interview.Rollup_Integration_Rollup_Order_Bys(
new Map<String, Object>{ 'rollupChildren' => new List<RollupChild__c>{ childOne, childTwo } }
);

Test.startTest();
flowInterview.start();
Test.stopTest();

parent = [SELECT TextField__c FROM RollupParent__c WHERE Id = :parent.Id];
System.assertEquals(childTwo.TextField__c, parent.TextField__c);
}
}
2 changes: 1 addition & 1 deletion extra-tests/classes/InvocableDrivenTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupCalcItemSorterTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupCalculatorTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupCurrencyInfoTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupDateLiteralTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupEvaluatorTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupFinalizerTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
4 changes: 2 additions & 2 deletions extra-tests/classes/RollupFlowFullRecalcTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupFlowTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupFullRecalcTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupIntegrationTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupLimitsTest.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupLoggerTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
4 changes: 2 additions & 2 deletions extra-tests/classes/RollupMultiCurrencyTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupQueryBuilderTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupRecursionItemTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupRepositoryTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupSObjectUpdaterTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupTestUtils.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupTests.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</values>
<values>
<field>Ranking__c</field>
<value xsi:type="xsd:double">1.0</value>
<value xsi:type="xsd:double">0.0</value>
</values>
<values>
<field>Rollup__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</values>
<values>
<field>Ranking__c</field>
<value xsi:type="xsd:double">0.0</value>
<value xsi:type="xsd:double">1.0</value>
</values>
<values>
<field>Rollup__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<assignments>
<name>Add_Records_To_Collections</name>
<label>Add Records To Collections</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<actionCalls>
<name>Recalc_Rollups</name>
Expand All @@ -18,7 +18,7 @@
<storeOutputAutomatically>true</storeOutputAutomatically>
<versionSegment>1</versionSegment>
</actionCalls>
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<environments>Default</environments>
<interviewLabel>Rollup Integration: Comma-Separated Full Recalc {!$Flow.CurrentDateTime}</interviewLabel>
<label>Rollup Integration: Comma-Separated Full Recalc</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<assignments>
<name>Add_case_and_prior_case_to_collections</name>
<label>Add case and prior case to collections</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<assignments>
<name>Add_to_collections</name>
<label>Add to collections</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<actionCalls>
<name>Rollup_ContactPointConsent_Record</name>
Expand Down Expand Up @@ -44,7 +44,7 @@
<storeOutputAutomatically>true</storeOutputAutomatically>
<versionSegment>1</versionSegment>
</actionCalls>
<apiVersion>61.0</apiVersion>
<apiVersion>62.0</apiVersion>
<environments>Default</environments>
<interviewLabel>Rollup Integration - Refresh With Empty Collections {!$Flow.CurrentDateTime}</interviewLabel>
<label>Rollup Integration - Refresh With Empty Collections</label>
Expand Down
Loading