v1.4.0 - Adds support for multiple orderings for FIRST/LAST rollups #243
jamessimone
announced in
Release Announcements
Replies: 1 comment
-
Updated to point out that the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Bumping the minor version number, as this release introduces new CMDT for FIRST/LAST rollups and includes a (small) number of breaking changes
Bug Fixes
field path
Updates
Rollup__mdt.Description__c
field to base Rollup metadataRollupOrderBy__mdt
orRollup Order By
releasedRollup__mdt.OrderByFirstLast__c
- it will still exist on the backend, but ideally people using FIRST/LAST will migrate over to the use of the new Rollup Order By metadataField Name
- the field name to order by (can be a parent-level field, just like in SOQL)Ranking
the ranking order for sorting. Can start with 0 or 1.Sort Order
(optional) - "Specifies whether the results are ordered in ascending (ASC
) or descending (DESC
) order. Default order is ascending."Null Sort Order
(optional) - "Orders null records at the beginning (NULLS FIRS
) or end (NULLS LAST
) of the results. By default, null values are sorted first."Rollup
- lookup to the Rollup CMDT recordNull Sort Order
on eachRollupOrderBy__mdt
record accordinglyOrder By First/Last
field corresponds to the format in the next bullet point/screenshot:Rollup__mdt.OrderByFirstLast__c
; in order to continue to support Flow, this field will remain in use as a translation layer between Flow & Apex; you can use a comma-separated list of fields that roughly correspond to the equivalentRollupOrderBy__mdt
record, like:Account.Name ascending nulls last, Amount descending
whereascending
ordescending
correspond to theRollupOrderBy__mdt.SortOrder__c
picklist values, and something likenulls last
corresponds toRollupOrderBy__mdt.NullSortOrder__c
's picklist values. I would still highly recommend migrating your FIRST/LAST rollups over to using theRollup Order By
CMDT records.Rollup.firstFromApex
orRollup.lastFromApex
methods looking to retain the old default behavior for sorting on nulls (reminder: in SOQL, nulls are sorted first unlessNULLS LAST
is used; Apex Rollup sorted nulls last by default previously) must update to the newfirstFromApex
/lastFromApex
method signatures, which allow you to pass aList<RollupOrderBy__mdt>
. You can create these in-memory for rollups that are not CMDT-configured, like the example below (which uses a Task -> Contact rollup):Rollup Order By
record:As much as possible, I try to limit making breaking changes in the Rollup API. This is only the third such breaking change since formalizing the release process here; in this case I feel good about the changes because I think there is a minimal amount of work necessary to support the upgrade to
v1.4.0
As always, a big thanks to @jongpie for his help in reviewing this release, as well as in contributing to it (shout out to @nojanv for his help as well)!
This discussion was created from the release v1.4.0 - Adds support for multiple orderings for FIRST/LAST rollups.
Beta Was this translation helpful? Give feedback.
All reactions