@palerock/exam-qa 1.0.6-patch2 → 1.0.6-patch20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +1 -1
- package/dist/static/css/app.4293d3540537974d843eca825dcda382.css +2 -0
- package/dist/static/css/app.4293d3540537974d843eca825dcda382.css.map +1 -0
- package/dist/static/js/app.e278f9557d317b4606b0.js +2 -0
- package/dist/static/js/app.e278f9557d317b4606b0.js.map +1 -0
- package/dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +1 -1
- package/lib-json/Dev1/345/237/272/347/241/200/351/242/230.json +1407 -0
- package/lib-json/Dev1/346/250/241/346/213/237/345/215/267A.json +1538 -0
- package/lib-json/Dev1/346/250/241/346/213/237/345/215/267B.json +1534 -0
- package/lib-json/Dev1/346/265/201/347/250/213/350/207/252/345/212/250/345/214/226/344/270/216/351/200/273/350/276/2211.json +1587 -0
- package/lib-json/Dev1/346/265/201/347/250/213/350/207/252/345/212/250/345/214/226/344/270/216/351/200/273/350/276/2212.json +1042 -0
- package/lib-json/Dev1/346/265/213/350/257/225_/350/260/203/350/257/225_/351/203/250/347/275/262.json +928 -0
- package/lib-json/Dev1/347/224/250/346/210/267/347/225/214/351/235/242.json +1243 -0
- package/lib-json/[DEV2]Salesforce/345/237/272/347/241/200.json +375 -0
- package/lib-json/[DEV2]/346/200/247/350/203/275.json +728 -0
- package/lib-json/[DEV2]/346/250/241/346/213/237/345/215/267A.json +1403 -0
- package/lib-json/[DEV2]/346/250/241/346/213/237/345/215/267B.json +1387 -0
- package/lib-json/[DEV2]/346/265/213/350/257/225/344/270/216/351/203/250/347/275/262.json +828 -0
- package/lib-json/[DEV2]/347/224/250/346/210/267/347/225/214/351/235/2421.json +977 -0
- package/lib-json/[DEV2]/347/224/250/346/210/267/347/225/214/351/235/2422.json +667 -0
- package/lib-json/[DEV2]/351/200/273/350/276/221/343/200/201/346/265/201/347/250/213/350/207/252/345/212/250/345/214/226/345/222/214/351/233/206/346/210/2201.json +1387 -0
- package/lib-json/[DEV2]/351/200/273/350/276/221/343/200/201/346/265/201/347/250/213/350/207/252/345/212/250/345/214/226/345/222/214/351/233/206/346/210/2202.json +260 -0
- package/lib-json/[JS]/347/254/254/344/270/200/347/253/240 /345/217/230/351/207/217-/347/261/273/345/236/213-/351/233/206/345/220/210.json" +1048 -0
- package/lib-json/[JS]/347/254/254/344/270/203/347/253/240 /346/265/213/350/257/225.json" +356 -0
- package/lib-json/[JS]/347/254/254/344/270/211/347/253/240 /346/265/217/350/247/210/345/231/250/345/222/214/344/272/213/344/273/266.json" +851 -0
- package/lib-json/[JS]/347/254/254/344/272/214/347/253/240 /345/257/271/350/261/241-/345/207/275/346/225/260-/347/261/273.json" +1787 -0
- package/lib-json/[JS]/347/254/254/344/272/224/347/253/240 /345/274/202/346/255/245/347/274/226/347/250/213.json" +547 -0
- package/lib-json/[JS]/347/254/254/345/205/255/347/253/240 /346/234/215/345/212/241/345/231/250/347/253/257JavaScript.json" +613 -0
- package/lib-json/[JS]/347/254/254/345/233/233/347/253/240 /350/260/203/350/257/225/345/222/214/351/224/231/350/257/257/345/244/204/347/220/206.json" +525 -0
- package/lib-json/[/345/222/270/351/261/274]AppBuilder-1.json +977 -0
- package/lib-json/[/345/222/270/351/261/274]AppBuilder-2.json +941 -0
- package/lib-json/[/345/222/270/351/261/274]AppBuilder-3.json +973 -0
- package/lib-json/[/345/222/270/351/261/274]AppBuilder-4.json +981 -0
- package/lib-json/[/345/222/270/351/261/274]AppBuilder-5.json +771 -0
- package/lib-json/map.json +28 -43
- package/package.json +4 -2
- package/dist/static/css/app.d3e969a579969be885a3462a1e12e37f.css +0 -2
- package/dist/static/css/app.d3e969a579969be885a3462a1e12e37f.css.map +0 -1
- package/dist/static/js/app.53370ddfe5eba6a10565.js +0 -2
- package/dist/static/js/app.53370ddfe5eba6a10565.js.map +0 -1
- package/lib-json/Salesforce-Admin(302)-[Set-10].json +0 -321
- package/lib-json/Salesforce-Admin(302)-[Set-1].json +0 -301
- package/lib-json/Salesforce-Admin(302)-[Set-2].json +0 -325
- package/lib-json/Salesforce-Admin(302)-[Set-3].json +0 -305
- package/lib-json/Salesforce-Admin(302)-[Set-4].json +0 -325
- package/lib-json/Salesforce-Admin(302)-[Set-5].json +0 -329
- package/lib-json/Salesforce-Admin(302)-[Set-6].json +0 -322
- package/lib-json/Salesforce-Admin(302)-[Set-7].json +0 -321
- package/lib-json/Salesforce-Admin(302)-[Set-8].json +0 -321
- package/lib-json/Salesforce-Admin(302)-[Set-9].json +0 -325
- package/lib-json/Salesforce-Admin-201-[Set-10].json +0 -158
- package/lib-json/Salesforce-Admin-201-[Set-1].json +0 -604
- package/lib-json/Salesforce-Admin-201-[Set-2].json +0 -621
- package/lib-json/Salesforce-Admin-201-[Set-3].json +0 -650
- package/lib-json/Salesforce-Admin-201-[Set-4].json +0 -636
- package/lib-json/Salesforce-Admin-201-[Set-5].json +0 -640
- package/lib-json/Salesforce-Admin-201-[Set-6].json +0 -126
- package/lib-json/Salesforce-Admin-201-[Set-7].json +0 -126
- package/lib-json/Salesforce-Admin-201-[Set-8].json +0 -126
- package/lib-json/Salesforce-Admin-201-[Set-9].json +0 -126
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-1].json +0 -321
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-2].json +0 -325
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-3].json +0 -321
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-4].json +0 -337
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-5].json +0 -329
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-6].json +0 -325
- package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-7].json +0 -480
- package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-1].json +0 -305
- package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-2].json +0 -297
- package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-3].json +0 -269
- package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-4].json +0 -309
- package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-5].json +0 -515
- package/lib-json/app-builder-01.json +0 -1
- package/lib-json/app-builder-02.json +0 -1
- package/lib-json/app-builder-03.json +0 -1
- package/lib-json/app-builder-04.json +0 -1
- package/lib-json/app-builder-05.json +0 -1
- package/lib-json/app-builder-06.json +0 -1
- package/lib-json/app-builder-07.json +0 -1
- package/lib-json/app-builder-08.json +0 -1
- package/lib-json/app-builder-09.json +0 -1
- package/lib-json/app-builder-10.json +0 -1
- package/lib-json/app-builder-11.json +0 -311
@@ -0,0 +1,260 @@
|
|
1
|
+
{
|
2
|
+
"title": "逻辑、流程自动化和集成2",
|
3
|
+
"category": "Dev2-自由部落侠",
|
4
|
+
"questions": [
|
5
|
+
{
|
6
|
+
"describe": "<p>A developer created a Lightning web component for the Account record page that displays the five recently contacted Contacts for an Account. The Apex method, getRecentContacts, returns a list of Contacts and will be wired to a property in the component.</p><p><br/></p><p>01:</p><p>02: public class ContactFetcher {</p><p>03:</p><p>04: static List<Contact> getRecentContacts(Id accountId) {</p><p>05: List<Contact> contacts = getFiveMostRecent(accountId) ;</p><p>06: return contacts;</p><p>07: }</p><p>08:</p><p>09: private static List<Contact> getFiveMostRecent(Id accountId) {</p><p>10: // ...impletation...</p><p>11: }</p><p>12: }</p><p><br/></p><p>Which two lines must change in the above code to make the Apex method able to be wired? Choose 2 answers</p><p><br/></p>",
|
7
|
+
"answerOptions": [
|
8
|
+
{
|
9
|
+
"describe": "<p>Add public to line 04.</p>",
|
10
|
+
"isRight": true
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"describe": "<p>Add @AuraEnabled(cacheable=true) to line 03.</p>",
|
14
|
+
"isRight": true
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"describe": "<p>Remove private from line 09.</p>",
|
18
|
+
"isRight": false
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"describe": "<p>Add @AuraEnabled(cacheable=true) to line 08.</p>",
|
22
|
+
"isRight": false
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"hashCode": "2019145547",
|
26
|
+
"analysis": ""
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"describe": "<p>The Account object has a field, Audit_Code__c, that is used to specify what type of auditing the Account needs and a Lookup to User, Auditor__c, that is the assigned auditor.</p><p>When an Account is initially created, the user specifies the Audit_Code__c. Each User in the org has a unique text field, Audit_Code__c, that is used to automatically assign the correct user to the Account's Auditor__c field.</p><p><br/></p><p>trigger AccountTrigger on Account(before insert) {</p><p> AuditAssigner.setAuditor(Trigger.new);</p><p>}</p><p><br/></p><p>public class AuditAssigner{</p><p> public static void setAuditor(List<Account> accounts) {</p><p> for(User u : [SELECT Id, Audit_Code__c FROM User]) {</p><p> for(Account a : accounts) {</p><p> if(u.Audit_Code__c == a.Audit_Code__c) {</p><p> a.Auditor__c = u.Id;</p><p> }</p><p> }</p><p> }</p><p> }</p><p>}</p><p>What should be changed to most optimize the code's efficiency? Choose 2 answers</p><p><br/></p>",
|
30
|
+
"answerOptions": [
|
31
|
+
{
|
32
|
+
"describe": "<p>Build a Map<String, List<Account>> of audit code to accounts.</p>",
|
33
|
+
"isRight": true
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"describe": "<p>Add an initial SOQL query to get all distinct audit codes.</p>",
|
37
|
+
"isRight": false
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"describe": "<p>Build a Map<Id, List<String>> of Account Id to audit codes.</p>",
|
41
|
+
"isRight": false
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"describe": "<p>Add a WHERE clause to the SOQL query to filter on audit codes.</p>",
|
45
|
+
"isRight": true
|
46
|
+
}
|
47
|
+
],
|
48
|
+
"hashCode": "2019145545",
|
49
|
+
"analysis": ""
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"describe": "<p>Given the following code:</p><p><br/></p><p>for ( Contact c : SELECT Id, LastNaze FROM Contact WHERE CreatedDate = TODAY] )</p><p>{</p><p>Account a = [SELECT Id,Name FROM Account WHERE CreatedDate = TODAY LIMIT 5];</p><p>c.AccountId = a.Id;</p><p>update c;</p><p>}</p><p><br/></p><p>Assuming there were 10 Contacts and five Accounts created today, what is the expected result?</p><p><br/></p>",
|
53
|
+
"answerOptions": [
|
54
|
+
{
|
55
|
+
"describe": "<p>System.QueryException: List has more than one row for Assignment on Account</p>",
|
56
|
+
"isRight": true
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"describe": "<p>System.LimitException: Too many SOQL Queries on Contact</p>",
|
60
|
+
"isRight": false
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"describe": "<p>System.QueryException: Too many DML Statement errors on Contact</p>",
|
64
|
+
"isRight": false
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"describe": "<p>System.LimitException: Too many SOQL Queries on Account</p>",
|
68
|
+
"isRight": false
|
69
|
+
}
|
70
|
+
],
|
71
|
+
"hashCode": "2019145519",
|
72
|
+
"analysis": ""
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"describe": "<p>A developer created an Apex class that updates an Account based on input from a Lightning web component that is used to register an Account.The update to the Account should only be made if it has not already been registered.</p><p><br/></p><p>Account = [SELECT Id,Is_Registered_c FROM Account WHERE Id= : accountId]:</p><p>if (!account.Is_Registered_c){</p><p>Account.Is_Registered_c = true</p><p>//...set other account fields... </p><p>update account;</p><p>}</p><p><br/></p><p>What should the developer do to ensure that users do not overwrite each other's updates to the same Account if they make updates at the same time?</p><p><br/></p>",
|
76
|
+
"answerOptions": [
|
77
|
+
{
|
78
|
+
"describe": "<p>Use Database. update (account, false)</p>",
|
79
|
+
"isRight": false
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"describe": "<p>Add a try/catch block around the update.</p>",
|
83
|
+
"isRight": false
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"describe": "<p>Use upsert instead of update.</p>",
|
87
|
+
"isRight": false
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"describe": "<p>Use FOR UPDATE in a SOQL query.</p>",
|
91
|
+
"isRight": true
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"hashCode": "2019145490",
|
95
|
+
"analysis": ""
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"describe": "<p>Refer to the code below:</p><p><br/></p><p>List<opportunity> opportunities = [ELECT Id, Amount from opportunity ];</p><p>tor (opportunity opp: opportunities) {</p><p>// perform operation here</p><p>}</p><p><br/></p><p>When the code runs, it results in a System Limit Exception with the error message: Apex heap size too large.</p><p>What should be done to fox this error?</p><p><br/></p>",
|
99
|
+
"answerOptions": [
|
100
|
+
{
|
101
|
+
"describe": "<p>Use a SOQL for loop to process the data.</p>",
|
102
|
+
"isRight": true
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"describe": "<p>Convert the List into a set.</p>",
|
106
|
+
"isRight": false
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"describe": "<p>Use Limits.getLimitHeapSize().</p>",
|
110
|
+
"isRight": false
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"describe": "<p>Use a try/catch block to catch the error.</p>",
|
114
|
+
"isRight": false
|
115
|
+
}
|
116
|
+
],
|
117
|
+
"hashCode": "2019145488",
|
118
|
+
"analysis": ""
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"describe": "<p>A company wants to run different logic based on an Opportunity's record type.\nWhich code segment handles this request and follows best practices?</p>",
|
122
|
+
"answerOptions": [
|
123
|
+
{
|
124
|
+
"describe": "<p>RecordType recType_New = [SELECT Id, Name FROM RecordType WHERE SObjectType = 'Opportunity' AND IsActive = TRUE and Name = 'New' LIMIT 1];</p><p>RecordType recType_Renewal = [SELECT Id, Name FROM RecordType WHERE SObjectType = 'Opportunity' AND IsActive = TRUE and Name = 'Renewal' LIMIT 1];</p><p>for( Opportunity o: Trigger.new) {</p><p> if(o.RecordTypeId == recType_New) {</p><p> //do some logic Record Type 1",
|
125
|
+
"isRight": false
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"describe": "<p>Id recType_New = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New').getRecordTypeId();</p><p>RecordType recType_Renewal = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewal').getRecordTypeId();</p><p>for( Opportunity o: Trigger.new) {</p><p> if(o.RecordTypeId == recType_New) {</p><p> //do some logic Record Type 1</p><p> }</p><p> else if(o.RecordTypeI",
|
129
|
+
"isRight": true
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"describe": "<p>for( Opportunity o: Trigger.new) {</p><p> if(o.RecordTypeId == '012500000009WAr') {</p><p> //do some logic Record Type 1</p><p> }</p><p> else if(o.RecordTypeId == '012500000009WBe') {</p><p> //do some logic for Record Type 2</p><p> }</p><p>}</p><p><br/></p>",
|
133
|
+
"isRight": false
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"describe": "<p>List<RecordType> recTypes = [SELECT Id, Name FROM RecordType WHERE SObjectType = 'Opportunity' AND IsActive = True];</p><p>Map<String, Id> recTypeMap = new Map<String, Id>();</p><p>for( RecordType rt: recTypes) {</p><p> recTypeMap.put(rt.Name, rt.Id);</p><p>}</p><p>for( Opportunity o: Trigger.new) {</p><p> if(o.RecordTypeId == recTypeMap.get('New')) {</p><p> //do some logic Record Type 1</p><p>",
|
137
|
+
"isRight": false
|
138
|
+
}
|
139
|
+
],
|
140
|
+
"hashCode": "2019145430",
|
141
|
+
"analysis": ""
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"describe": "<p>Line 1 trigger ContactTrigger on Contact (before insert, before update) </p><p>Line 2 {</p><p>Line 3 Map<Id, Account> accountMap = new Map<Id, Account>();</p><p>Line 4 for(Contact c : Trigger.new)</p><p>Line 5 {</p><p>Line 6 Account a = [SELECT Id, Name, BillingCountry FROM Account WHERE Id := c.AccountId];</p><p>Line 7 accountMap.put(a.Id, a);</p><p>Line 8 }</p><p>line 9</p><p>Line 10 //Do stuff with accountMap</p><p>Line 11 for(Contact c : Trigger.new)</p><p>Line 12 {</p><p>Line 13 Account a = accountMap.get(c.AccountId);</p><p>Line 14 if(a != null) </p><p>Line 15 {</p><p>Line 16 c.BillingCountry = a.BillingCountry;</p><p>Line 17 }</p><p>Line 18 }</p><p>Line 19</p><p>Line 20 update Trigger.new;</p><p>Line 21 }</p><p>Refer to the code segment above</p><p>When following best practices for writing Apex triggers, which two lines are wrong or cause for concern?Choose 2 answers</p><p><br/></p>",
|
145
|
+
"answerOptions": [
|
146
|
+
{
|
147
|
+
"describe": "<p>Line 6</p>",
|
148
|
+
"isRight": true
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"describe": "<p>Line 11</p>",
|
152
|
+
"isRight": false
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"describe": "<p>Line 16</p>",
|
156
|
+
"isRight": false
|
157
|
+
},
|
158
|
+
{
|
159
|
+
"describe": "<p>Line 20</p>",
|
160
|
+
"isRight": true
|
161
|
+
}
|
162
|
+
],
|
163
|
+
"hashCode": "2019145428",
|
164
|
+
"analysis": ""
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"describe": "<p>Refer to the code snippet below:</p><p><br/></p><p>public static void updateCreditMemo(String customerId, Decimal newAmount) {</p><p> List<Credit_Memo__c> toUpdate = new List<Credit_Memo__c>( ) ;</p><p> for (Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = : customerId LIMIT 50]) {</p><p> creditMemo.Amount__c = newAmount;</p><p> toUpdate.add(creditMemo) ;</p><p> }</p><p>Database.update(toUpdate, false);</p><p>}</p><p><br/></p><p>A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified within an Apex transaction.</p><p><br/></p><p>In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race conditions within a transaction?</p><p><br/></p>",
|
168
|
+
"answerOptions": [
|
169
|
+
{
|
170
|
+
"describe": "<p>[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR UPDATE]</p>",
|
171
|
+
"isRight": true
|
172
|
+
},
|
173
|
+
{
|
174
|
+
"describe": "<p>[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId FOR REFERENCE LIMIT 50]</p>",
|
175
|
+
"isRight": false
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"describe": "<p>[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR PREFERENCE]</p>",
|
179
|
+
"isRight": false
|
180
|
+
},
|
181
|
+
{
|
182
|
+
"describe": "<p>The executeBatch must fall within test.startTest() and test.stopTest().</p>",
|
183
|
+
"isRight": false
|
184
|
+
}
|
185
|
+
],
|
186
|
+
"hashCode": "2019145425",
|
187
|
+
"analysis": "<p>https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_for_update.htm</p>"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"describe": "<p>Refer to the code snippet below:</p><p>01 public void createChildRecord(String externalIdenifier) {</p><p>02 Account parentAccount;</p><p>03</p><p>04 Contact newContact = new contact();</p><p>05 newContact.Account = parentAccount;</p><p>06</p><p>07 insert(newContact);</p><p>08 }</p><p>As part of an integration development effort, a developer is tasked to create an Apex method that solely relies on the use of foreign </p><p>identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as </p><p>an external ID, the API Name of this field is Legacy_Id__c.</p><p>What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created contact is properly </p><p>related to the Account?</p><p><br/></p>",
|
191
|
+
"answerOptions": [
|
192
|
+
{
|
193
|
+
"describe": "<p>Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id__c =:externalIdentifier].Id;</p>",
|
194
|
+
"isRight": false
|
195
|
+
},
|
196
|
+
{
|
197
|
+
"describe": "<p>Account parentAccount = new Account (Legacy_Id__c =externalIdentifier);</p>",
|
198
|
+
"isRight": false
|
199
|
+
},
|
200
|
+
{
|
201
|
+
"describe": "<p>Account parentAccount = [SELECT Id FROM Account WHERE Legacy_Id__c =:externalIdentifier];</p>",
|
202
|
+
"isRight": true
|
203
|
+
},
|
204
|
+
{
|
205
|
+
"describe": "<p>Account parentAccount = new Account();</p><p>parentAccount.Id =externalIdentifier;</p><p><br/></p>",
|
206
|
+
"isRight": false
|
207
|
+
}
|
208
|
+
],
|
209
|
+
"hashCode": "2019145424",
|
210
|
+
"analysis": ""
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"describe": "<p>trigger AssignOwnerByRegion on Account(before insert, before update)</p><p>{</p><p> List<Account> accountList = new List<Account>();</p><p> for(Account anAccount : trigger.new )</p><p> {</p><p> Region__c theRegion = [SELECT Id, Name, Region_Manager__c FROM Region__c WHERE Name= :anAccount.Region_Name__c];</p><p> anAccount.OwnerId = theRegion.Region_Manager__c;</p><p> accountList.add(anAccount);</p><p> }</p><p> update accountList;</p><p>}</p><p><br/></p><p>Consider the above trigger intended to assign the Account to the manager of the Account's region.</p><p>Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers</p><p><br/></p>",
|
214
|
+
"answerOptions": [
|
215
|
+
{
|
216
|
+
"describe": "<p>Remove the last line updating accountList as it is not needed.</p>",
|
217
|
+
"isRight": true
|
218
|
+
},
|
219
|
+
{
|
220
|
+
"describe": "<p>Move the Region__c query to outside the loop.</p>",
|
221
|
+
"isRight": true
|
222
|
+
},
|
223
|
+
{
|
224
|
+
"describe": "<p>Use a Map accountMap instead of List accountList.</p>",
|
225
|
+
"isRight": false
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"describe": "<p>Use a Map to cache the results of the Region__c query by Id.</p>",
|
229
|
+
"isRight": false
|
230
|
+
}
|
231
|
+
],
|
232
|
+
"hashCode": "2019145392",
|
233
|
+
"analysis": ""
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"describe": "<p>A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.</p><p><br/></p><p>public void updateAndMakeCallout(Map<Id, Request__c> reqs,</p><p>Map<Id, Request_Line__c> reqLines) {</p><p> Savepoint sp = Database.setSavepoint( );</p><p><br/></p><p> try {</p><p> insert reqs.values( );</p><p> insert reqLines.values( );</p><p> HttpResponse response = CalloutUtil.makeRestCallout(reqs.keySet( ), reqLines.keySet( ));</p><p> } catch (Exception e) {</p><p> Database.rollback (sp) ;</p><p> System.debug(e) ;</p><p> }</p><p>}</p><p><br/></p><p>The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error.</p><p><br/></p><p>What should be done to address the problem?</p><p><br/></p>",
|
237
|
+
"answerOptions": [
|
238
|
+
{
|
239
|
+
"describe": "<p>Remove the Database.setSavepoint and Database.rollback.</p>",
|
240
|
+
"isRight": false
|
241
|
+
},
|
242
|
+
{
|
243
|
+
"describe": "<p>Change the CalloutUtil.makeRestCallout to an @future method.</p>",
|
244
|
+
"isRight": true
|
245
|
+
},
|
246
|
+
{
|
247
|
+
"describe": "<p>Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.</p>",
|
248
|
+
"isRight": false
|
249
|
+
},
|
250
|
+
{
|
251
|
+
"describe": "<p>Move the CalloutUtil.makeRestCallout method call below the catch block.</p>",
|
252
|
+
"isRight": false
|
253
|
+
}
|
254
|
+
],
|
255
|
+
"hashCode": "2019145391",
|
256
|
+
"analysis": ""
|
257
|
+
}
|
258
|
+
],
|
259
|
+
"hashCode": "443919539"
|
260
|
+
}
|