v3.2.2
27-March-2024
New
withFieldSet(String fieldSetName)byRecordType(String recordTypeDeveloperName)
Refactoring
- API 60 Update
- Iterable for
with(String relationshipName, Iterable<SObjectField> fields) - Code refactoring
withFieldSet
Pass FieldSet name to get dynamic fields. It can be very useful to have a dynamic UI.
Signature
Queryable withFieldSet(String fieldSetName)Example
SELECT
Id,
Name,
Industry
FROM AccountSOQL.of(Account.SObjectType)
.withFieldSet('AccountFieldSet')
.toList();byRecordType
Query record by RecordType.DeveloperName. To do that, you can use the byRecordType method.
🚨 If you already have a method called byRecordType in your selector, you may encounter the following issues:
Non-virtual, non-abstract methods cannot be overridden: YourSelector YourSelector.byRecordType(String)
You have two options:
- You can remove the
byRecordTypefrom your selector and use the predefined method from the SOQL library. - You can skip that update and still use
byRecordTypefrom your selector.
Signature
Queryable byRecordType(String recordTypeDeveloperName)Example
SELECT Id
FROM Account
WHERE RecordType.DeveloperName = 'Partner'SOQL.of(Account.SObjectType)
.byRecordType('Partner')
.toList();API 60 Update
🚨Do not forget to update ALL selectors to API 60.
Selectors with API < 60 that are using the isIn method will encounter the following error:
Method does not exist or incorrect signature: void isIn(List<String>) from the type SOQL.Filter
Salesforce has made some changes, and this update is necessary!
Iterable for with(String relationshipName, Iterable<SObjectField> fields)
Now you can pass List<SObjectField> as well as Set<SObjectField> to with(String relationshipName, Iterable<SObjectField> fields).
Code refactoring
Unused lines of code were removed. Null Coalescing Operator was applied.