어느 Salesforce Developer의 개발 성장기

[Salesforce Certified Platform Developer1] Dump 오답 일기8 본문

Salesforce Dump/Platform Developer1 Dump

[Salesforce Certified Platform Developer1] Dump 오답 일기8

Developer_Foryou 2020. 3. 8. 00:59

※ 각 자격증별 Dump는 시험을 준비하면서, 
웹상에 공개된 Dump와 유료 Dump를 풀면서 자주 틀렸던 문제를 위주로 작성하였습니다. 
오래된 문제도 간혹 있기 때문에 버전에 따라 답이 다른 경우도 있으며,
개인이 공부하면서 푼 문제이기 때문에 오답일 가능성도 있습니다.
이점 유의하여 공부하시길 바랍니다.

 

Where can the custom roll-up summary fields be created using standard object relationships (choose 3)

A. On Opportunity using Opportunity Product records.
B. On Account using Case records.
C. On Quote using Order records.
D. On Campaign using Campaign Member records.
E. On Account using Opportunity records.

Answer A, D, E

In which order does salesforce execute events upon saving a record?

A. Before Triggers; Validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit
B. Validation Rules; Before Triggers; After Triggers; Workflow Rules; Assignment Rules; Commit
C. Before Triggers; Validation Rules; After Triggers; Workflow Rules; Assignment Rules; Commit
D. Validation Rules; Before Trigger; After Triggers; Assignment Rules; Workflow Rules; Commit

Answer A

A developer creates an Apex class that includes private methods. What can the developer do to ensure that the private methods can be accessed by the test class?

A. Add the TestVisble attribute to the Apex class
B. Add the SeeAllData attribute to the test methods.
C. Add the TestVisible attribute to the apex methods.
D. Add the SeeAllData attribute to the test class

Answer C

Considerations for the @IsTest(SeeAllData=true) Annotation

  • If a test class is defined with the @isTest(SeeAllData=true) annotation, the annotation applies to all its test methods whether the test methods are defined with the @isTest annotation or the (deprecated) testMethod keyword.
  • The @isTest(SeeAllData=true) annotation is used to open up data access when applied at the class or method level. However, if the containing class has been annotated with @isTest(SeeAllData=true), annotating a method with @isTest(SeeAllData=false) is ignored for that method. In this case, that method still has access to all the data in the organization. Annotating a method with @isTest(SeeAllData=true) overrides, for that method, an @isTest(SeeAllData=false) annotation on the class.
  • @isTest(SeeAllData=true) and @isTest(isParallel=true) annotations cannot be used together on the same Apex method.

 

What is the proper process for an Apex Unit Test?

A. Query for test data using SeeAllData = true. Call the method being tested. Verify that the results are correct.
B. Query for test data using SeeAllData = true. Execute runAllTests(). Verify that the results are correct.
C. Create data for testing. Execute runAllTests(). Verify that the results are correct.
D. Create data for testing. Call the method being tested. Verify that the results are correct.

Answer D

When loading data into an operation, what can a developer do to match records to update existing records? (Choose 2)

A. Match an auto-generated Number field to a column in the imported file.
B. Match an external Id Text field to a column in the imported file.
C. Match the Name field to a column in the imported file.
D. Match the Id field to a column in the imported file.

Answer B, D

 

A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:Account myAccount = new Account(Name = 'MyAccount');Insert myAccount;For (Integer x = 0; x < 150; x++) {Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;} catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount');How many accounts are in the org after this code is run?

A. 101
B. 100
C. 102
D. 252

Answer B

System.LimitException: Too many DML statements: 151
so, roll back. and nothing will be inserted.

A developer creates a custom controller and custom Visualforce page by using the following code block:

public class myController {
     public String myString;
     public String getMyString() {
         return 'getmyString';
     }
     public String getStringMethod1() {
         return myString;
     }
     public String getStringMethod2() {
         if (myString == null){
               myString = 'Method2';
               return myString;

          }

     }
}

{!myString}, {!StringMethod1}, {!StringMethod2}, {!myString}

What does the user see when accessing the custom page?

A. GetMyString , , Method2 , getMystring
B. , , Method2 , getMyString
C. , , Method2,
D. GetMyString , , ,

Answer A

A company wants a recruiting app that models candidates and interviews; displays the total number of interviews on each candidate record; and defines security on interview records that is independent from the security on candidate records. What would a developer do to accomplish this task? Choose 2 answers

A. Create a roll -up summary field on the Candidate object that counts Interview records.
B. Create a master -detail relationship between the Candidate and Interview objects.
C. Create a lookup relationship between the Candidate and Interview objects.
D. Create a trigger on the Interview object that updates a field on the Candidate object.

Answer C, D

What is a capability of a StandardSetController?Choose 2 answers

A. It allows pages to perform mass updates of records
B. It allows pages to perform pagination with large record sets
C. It enforces field-level security when reading large record sets
D. It extends the functionality of a standard or custom controller

Answer A, B

StandardSetController objects allow you to create list controllers similar to, or as extensions of, the pre-built Visualforce list controllers provided by Salesforce.
The StandardSetController class also contains a prototype object. This is a single sObject contained within the Visualforce StandardSetController class. If the prototype object's fields are set, those values are used during the save action, meaning that the values are applied to every record in the set controller's collection. This is useful for writing pages that perform mass updates (applying identical changes to fields within a collection of objects).
public class opportunityList2Con {
     // ApexPages.StandardSetController must be instantiated
     // for standard list controllers
     public ApexPages.StandardSetController setCon {
          get {
               if(setCon == null) {
                    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                              [SELECT Name, CloseDate FROM Opportunity]));

               }
               return setCon;
          }
          set;

     }

     // Initialize setCon and return a list of records
     public List<Opportunity> getOpportunities() {
          return (List<Opportunity>) setCon.getRecords();
     }
}

 

<apex:page controller="opportunityList2Con">
     <apex:pageBlock>
          <apex:pageBlockTable value="{!opportunities}" var="o">

               <apex:column value="{!o.Name}"/>
               <apex:column value="{!o.CloseDate}"/>
          </apex:pageBlockTable>
     </apex:pageBlock>
</apex:page>

What is the minimum log level needed to see user-generated debug statements?

A. DEBUG
B. FINE
C. INFO
D. WARN

Answer A

Debug Log Levels

  • NONE
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • FINE
  • FINER
  • FINEST
Comments