@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.
Files changed (83) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/static/css/app.4293d3540537974d843eca825dcda382.css +2 -0
  3. package/dist/static/css/app.4293d3540537974d843eca825dcda382.css.map +1 -0
  4. package/dist/static/js/app.e278f9557d317b4606b0.js +2 -0
  5. package/dist/static/js/app.e278f9557d317b4606b0.js.map +1 -0
  6. package/dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +1 -1
  7. package/lib-json/Dev1/345/237/272/347/241/200/351/242/230.json +1407 -0
  8. package/lib-json/Dev1/346/250/241/346/213/237/345/215/267A.json +1538 -0
  9. package/lib-json/Dev1/346/250/241/346/213/237/345/215/267B.json +1534 -0
  10. 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
  11. 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
  12. 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
  13. package/lib-json/Dev1/347/224/250/346/210/267/347/225/214/351/235/242.json +1243 -0
  14. package/lib-json/[DEV2]Salesforce/345/237/272/347/241/200.json +375 -0
  15. package/lib-json/[DEV2]/346/200/247/350/203/275.json +728 -0
  16. package/lib-json/[DEV2]/346/250/241/346/213/237/345/215/267A.json +1403 -0
  17. package/lib-json/[DEV2]/346/250/241/346/213/237/345/215/267B.json +1387 -0
  18. package/lib-json/[DEV2]/346/265/213/350/257/225/344/270/216/351/203/250/347/275/262.json +828 -0
  19. package/lib-json/[DEV2]/347/224/250/346/210/267/347/225/214/351/235/2421.json +977 -0
  20. package/lib-json/[DEV2]/347/224/250/346/210/267/347/225/214/351/235/2422.json +667 -0
  21. 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
  22. 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
  23. 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
  24. package/lib-json/[JS]/347/254/254/344/270/203/347/253/240 /346/265/213/350/257/225.json" +356 -0
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. package/lib-json/[/345/222/270/351/261/274]AppBuilder-1.json +977 -0
  31. package/lib-json/[/345/222/270/351/261/274]AppBuilder-2.json +941 -0
  32. package/lib-json/[/345/222/270/351/261/274]AppBuilder-3.json +973 -0
  33. package/lib-json/[/345/222/270/351/261/274]AppBuilder-4.json +981 -0
  34. package/lib-json/[/345/222/270/351/261/274]AppBuilder-5.json +771 -0
  35. package/lib-json/map.json +28 -43
  36. package/package.json +4 -2
  37. package/dist/static/css/app.d3e969a579969be885a3462a1e12e37f.css +0 -2
  38. package/dist/static/css/app.d3e969a579969be885a3462a1e12e37f.css.map +0 -1
  39. package/dist/static/js/app.53370ddfe5eba6a10565.js +0 -2
  40. package/dist/static/js/app.53370ddfe5eba6a10565.js.map +0 -1
  41. package/lib-json/Salesforce-Admin(302)-[Set-10].json +0 -321
  42. package/lib-json/Salesforce-Admin(302)-[Set-1].json +0 -301
  43. package/lib-json/Salesforce-Admin(302)-[Set-2].json +0 -325
  44. package/lib-json/Salesforce-Admin(302)-[Set-3].json +0 -305
  45. package/lib-json/Salesforce-Admin(302)-[Set-4].json +0 -325
  46. package/lib-json/Salesforce-Admin(302)-[Set-5].json +0 -329
  47. package/lib-json/Salesforce-Admin(302)-[Set-6].json +0 -322
  48. package/lib-json/Salesforce-Admin(302)-[Set-7].json +0 -321
  49. package/lib-json/Salesforce-Admin(302)-[Set-8].json +0 -321
  50. package/lib-json/Salesforce-Admin(302)-[Set-9].json +0 -325
  51. package/lib-json/Salesforce-Admin-201-[Set-10].json +0 -158
  52. package/lib-json/Salesforce-Admin-201-[Set-1].json +0 -604
  53. package/lib-json/Salesforce-Admin-201-[Set-2].json +0 -621
  54. package/lib-json/Salesforce-Admin-201-[Set-3].json +0 -650
  55. package/lib-json/Salesforce-Admin-201-[Set-4].json +0 -636
  56. package/lib-json/Salesforce-Admin-201-[Set-5].json +0 -640
  57. package/lib-json/Salesforce-Admin-201-[Set-6].json +0 -126
  58. package/lib-json/Salesforce-Admin-201-[Set-7].json +0 -126
  59. package/lib-json/Salesforce-Admin-201-[Set-8].json +0 -126
  60. package/lib-json/Salesforce-Admin-201-[Set-9].json +0 -126
  61. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-1].json +0 -321
  62. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-2].json +0 -325
  63. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-3].json +0 -321
  64. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-4].json +0 -337
  65. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-5].json +0 -329
  66. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-6].json +0 -325
  67. package/lib-json/Salesforce-Certified-Platform-Developer-1-[Set-7].json +0 -480
  68. package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-1].json +0 -305
  69. package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-2].json +0 -297
  70. package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-3].json +0 -269
  71. package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-4].json +0 -309
  72. package/lib-json/Salesforce-Sales-Cloud-Certification(81)-[Set-5].json +0 -515
  73. package/lib-json/app-builder-01.json +0 -1
  74. package/lib-json/app-builder-02.json +0 -1
  75. package/lib-json/app-builder-03.json +0 -1
  76. package/lib-json/app-builder-04.json +0 -1
  77. package/lib-json/app-builder-05.json +0 -1
  78. package/lib-json/app-builder-06.json +0 -1
  79. package/lib-json/app-builder-07.json +0 -1
  80. package/lib-json/app-builder-08.json +0 -1
  81. package/lib-json/app-builder-09.json +0 -1
  82. package/lib-json/app-builder-10.json +0 -1
  83. 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:&nbsp; &nbsp; public class ContactFetcher&nbsp; {</p><p>03:</p><p>04:&nbsp; &nbsp; &nbsp; &nbsp; static List&lt;Contact&gt; getRecentContacts(Id accountId) {</p><p>05:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;Contact&gt; contacts = getFiveMostRecent(accountId) ;</p><p>06:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return contacts;</p><p>07:&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>08:</p><p>09:&nbsp; &nbsp; &nbsp; &nbsp; private static List&lt;Contact&gt; getFiveMostRecent(Id accountId) {</p><p>10:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // ...impletation...</p><p>11:&nbsp; &nbsp; &nbsp; &nbsp;}</p><p>12:&nbsp; &nbsp; }</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&#39;s Auditor__c field.</p><p><br/></p><p>trigger AccountTrigger on Account(before insert) {</p><p>&nbsp; &nbsp; AuditAssigner.setAuditor(Trigger.new);</p><p>}</p><p><br/></p><p>public class AuditAssigner{</p><p>&nbsp; &nbsp; public static void setAuditor(List&lt;Account&gt; accounts) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; for(User u : [SELECT Id, Audit_Code__c FROM User]) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(Account a : accounts) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(u.Audit_Code__c == a.Audit_Code__c) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a.Auditor__c = u.Id;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p><p>&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp;}</p><p>}</p><p>What should be changed to most optimize the code&#39;s efficiency? Choose 2 answers</p><p><br/></p>",
30
+ "answerOptions": [
31
+ {
32
+ "describe": "<p>Build a Map&lt;String, List&lt;Account&gt;&gt; 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&lt;Id, List&lt;String&gt;&gt; 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...&nbsp;&nbsp;</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&#39;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&lt;opportunity&gt; 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&#39;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 = &#39;Opportunity&#39; AND IsActive = TRUE and Name = &#39;New&#39; LIMIT 1];</p><p>RecordType recType_Renewal = [SELECT Id, Name FROM RecordType WHERE SObjectType = &#39;Opportunity&#39; AND IsActive = TRUE and Name = &#39;Renewal&#39; LIMIT 1];</p><p>for( Opportunity o: Trigger.new) {</p><p>&nbsp; &nbsp; &nbsp;if(o.RecordTypeId == recType_New) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //do some logic Record Type 1",
125
+ "isRight": false
126
+ },
127
+ {
128
+ "describe": "<p>Id recType_New = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get(&#39;New&#39;).getRecordTypeId();</p><p>RecordType recType_Renewal = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get(&#39;Renewal&#39;).getRecordTypeId();</p><p>for( Opportunity o: Trigger.new) {</p><p>&nbsp; &nbsp; &nbsp;if(o.RecordTypeId == recType_New) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //do some logic Record Type 1</p><p>&nbsp; &nbsp; &nbsp;}</p><p>&nbsp; &nbsp; &nbsp;else if(o.RecordTypeI",
129
+ "isRight": true
130
+ },
131
+ {
132
+ "describe": "<p>for( Opportunity o: Trigger.new) {</p><p>&nbsp; &nbsp; &nbsp;if(o.RecordTypeId == &#39;012500000009WAr&#39;) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //do some logic Record Type 1</p><p>&nbsp; &nbsp; &nbsp;}</p><p>&nbsp; &nbsp; &nbsp;else if(o.RecordTypeId == &#39;012500000009WBe&#39;) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //do some logic for Record Type 2</p><p>&nbsp; &nbsp; &nbsp;}</p><p>}</p><p><br/></p>",
133
+ "isRight": false
134
+ },
135
+ {
136
+ "describe": "<p>List&lt;RecordType&gt; recTypes = [SELECT Id, Name FROM RecordType WHERE SObjectType = &#39;Opportunity&#39; AND IsActive = True];</p><p>Map&lt;String, Id&gt; recTypeMap = new Map&lt;String, Id&gt;();</p><p>for( RecordType rt: recTypes) {</p><p>&nbsp; &nbsp; recTypeMap.put(rt.Name, rt.Id);</p><p>}</p><p>for( Opportunity o: Trigger.new) {</p><p>&nbsp; &nbsp; &nbsp;if(o.RecordTypeId == recTypeMap.get(&#39;New&#39;)) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //do some logic Record Type 1</p><p>",
137
+ "isRight": false
138
+ }
139
+ ],
140
+ "hashCode": "2019145430",
141
+ "analysis": ""
142
+ },
143
+ {
144
+ "describe": "<p>Line&nbsp; 1&nbsp; trigger ContactTrigger on Contact (before insert, before update)&nbsp;</p><p>Line&nbsp; 2&nbsp; {</p><p>Line&nbsp; 3&nbsp; &nbsp; &nbsp; &nbsp; Map&lt;Id, Account&gt; accountMap = new Map&lt;Id, Account&gt;();</p><p>Line&nbsp; 4&nbsp; &nbsp; &nbsp; &nbsp; for(Contact c : Trigger.new)</p><p>Line&nbsp; 5&nbsp; &nbsp; &nbsp; &nbsp; {</p><p>Line&nbsp; 6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Account a = [SELECT Id, Name, BillingCountry FROM Account WHERE Id := c.AccountId];</p><p>Line&nbsp; 7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accountMap.put(a.Id, a);</p><p>Line&nbsp; 8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p><p>line&nbsp; &nbsp;9</p><p>Line 10&nbsp; &nbsp; &nbsp; &nbsp; //Do stuff with accountMap</p><p>Line 11&nbsp; &nbsp; &nbsp; &nbsp; for(Contact c : Trigger.new)</p><p>Line 12&nbsp; &nbsp; &nbsp; &nbsp; {</p><p>Line 13&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Account a = accountMap.get(c.AccountId);</p><p>Line 14&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(a != null)&nbsp;</p><p>Line 15&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p><p>Line 16&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c.BillingCountry = a.BillingCountry;</p><p>Line 17&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p><p>Line 18&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>Line 19</p><p>Line 20&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update Trigger.new;</p><p>Line 21&nbsp; }</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>&nbsp; &nbsp; &nbsp;List&lt;Credit_Memo__c&gt; toUpdate = new List&lt;Credit_Memo__c&gt;( ) ;</p><p>&nbsp; &nbsp; &nbsp;for (Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = : customerId LIMIT 50]) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;creditMemo.Amount__c = newAmount;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;toUpdate.add(creditMemo) ;</p><p>&nbsp; &nbsp; &nbsp; }</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&nbsp; public void createChildRecord(String externalIdenifier) {</p><p>02&nbsp; &nbsp; &nbsp; Account parentAccount;</p><p>03</p><p>04&nbsp; &nbsp; &nbsp; Contact newContact = new contact();</p><p>05&nbsp; &nbsp; &nbsp; newContact.Account = parentAccount;</p><p>06</p><p>07&nbsp; &nbsp; &nbsp; &nbsp;insert(newContact);</p><p>08&nbsp; }</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&nbsp;</p><p>identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as&nbsp;</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&nbsp;</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>&nbsp; &nbsp;List&lt;Account&gt; accountList = new List&lt;Account&gt;();</p><p>&nbsp; &nbsp;for(Account anAccount : trigger.new )</p><p>&nbsp; &nbsp;{</p><p>&nbsp; &nbsp; &nbsp; Region__c theRegion = [SELECT Id, Name, Region_Manager__c FROM Region__c WHERE Name= :anAccount.Region_Name__c];</p><p>&nbsp; &nbsp; &nbsp; anAccount.OwnerId = theRegion.Region_Manager__c;</p><p>&nbsp; &nbsp; &nbsp; accountList.add(anAccount);</p><p>&nbsp; &nbsp;}</p><p>&nbsp; &nbsp;update accountList;</p><p>}</p><p><br/></p><p>Consider the above trigger intended to assign the Account to the manager of the Account&#39;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&#39;s REST endpoint with the updated records.</p><p><br/></p><p>public void updateAndMakeCallout(Map&lt;Id, Request__c&gt; reqs,</p><p>Map&lt;Id, Request_Line__c&gt; reqLines) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Savepoint sp = Database.setSavepoint( );</p><p><br/></p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;insert reqs.values( );</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;insert reqLines.values( );</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HttpResponse response = CalloutUtil.makeRestCallout(reqs.keySet( ), reqLines.keySet( ));</p><p>&nbsp; &nbsp; &nbsp; &nbsp;} catch (Exception e) {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Database.rollback (sp) ;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.debug(e) ;</p><p>&nbsp; &nbsp; &nbsp; &nbsp;}</p><p>}</p><p><br/></p><p>The CalloutUtil.makeRestCallout fails with a &#39;You have uncommitted work pending. Please commit or rollback before calling out&#39; 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
+ }