Skip to content

Commit 8fab2ea

Browse files
committed
example update
1 parent 0599266 commit 8fab2ea

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
public with sharing class AccountSelector implements SOQL.Selector {
1+
public inherited sharing class AccountSelector implements SOQL.Selector {
22
public static SOQL query() {
33
return SOQL.of(Account.SObjectType)
4-
.with(new List<SObjectField>{
5-
Account.Name,
6-
Account.AccountNumber
7-
})
4+
.with(Account.Name, Account.AccountNumber)
85
.systemMode()
96
.withoutSharing();
107
}
118

129
public static SOQL byRecordType(String rt) {
13-
return query().with(new List<SObjectField>{
14-
Account.BillingCity,
15-
Account.BillingCountry
16-
}).whereAre(SOQL.Filter.recordType().equal(rt));
10+
return query()
11+
.with(Account.BillingCity, Account.BillingCountry)
12+
.whereAre(SOQL.Filter.recordType().equal(rt));
1713
}
1814
}

force-app/main/default/classes/selector/ExampleController.cls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ public with sharing class ExampleController {
22

33
public static List<Account> getPartnerAccounts(String accountName) {
44
return AccountSelector.query()
5-
.with(Account.BillingCity)
6-
.with(Account.BillingCountry)
5+
.with(Account.BillingCity, Account.BillingCountry)
76
.whereAre(SOQL.FilterGroup
87
.add(SOQL.Filter.name().contains(accountName))
98
.add(SOQL.Filter.recordType().equal('Partner'))

0 commit comments

Comments
 (0)