Consider the below trigger intended to assign the Account to the manager of the Account's region:
Which two changes should a developer make in this trigger to adhere to best practices?
Choose 2 answers
A.
B.
C.
D.
正解:A,C
解説: (Pass4Test メンバーにのみ表示されます)
質問 2:
A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and 5P3 {created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls 2 roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a Funtime error occurs.
Why does the developer receive a runtime error?
A. The developer should have called SF2 before calling SP3.
B. SP3 became invalid when SP1 was rolled back.
C. The developer used too many savepoints in one trigger session.
D. The developer has too many DML statements between the savepoints.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 3:
A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.
What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?
A. Try/catch/finally block
B. External JavaScript library
C. Apex trigger
D. Validation rules
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 4:
A page throws an 'Attempt to dereference a null object' error for a Contact.
What change in the controller will fix the error?
A. Declare a static final Contact at the top of the controller.
B. Use a condition in the getter to return a new Contact if it is null.
G Change the setter's signature to return a Contact.
C. Change the getter's signature to be static Contact.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 5:
A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact.
Assuming the Name field exists, how should the developer do this?
A. describe) function to compare the values of each Name field.
B. Use the Salesforce Metadata API to extract the value of each object and compare the Name fields.
C. Use a string. Replace () method to parse the contents of each Name field and then compare the results.
D. Cast each object into an sObject and use sObject.get to compare the Name fields,
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 6:
Given the following containment hierarchy:
What is the correct way to communicate the new value of a property named ''passthrough'' to my-parent-component if the property is defined within my-child-component?
A.
B.
C.
D.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 7:
Universal Containers analyzes a Lightning web component and its Apex controller class that retrieves a list of contacts associated with an account. The code snippets are as follows:
Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?
A. Extend the lightning-datatable component in the Lightning web component to include a column for the MailingAddress field.
B. Modify the SOQL query in the getAccountContacts method to include the MailingAddress field and update the columns attribute in javascript file to add Mailing address fields.
C. Add a new method in the Apex controller class to retneve the mailing addresses separately and modify the Lightning web component to invoke this method.
D. Modify the SOQL guery in the getAccountContacts method to include the MailingAddress field.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 8:
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?
A. The test class has not implemented seealldata=true in the test method.
B. The test class has not re-queried the Account record after updating the Opportunity.
C. The test class is not using System. runs () to run tests as a Salesforce administrator.
D. The test class has not defined an Account owner when inserting the test data.
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
Mita -
よく出題されるパターンを徹底分析した予想問題集ですね。Pass4Testさん、また来ますよ。