Salesforce Platform Dev I Sample Test Flashcards
Why would a developer use Test. startTest( ) and Test.stopTest( )?
A. To avoid Apex code coverage requirements for the code between these lines
B. To start and stop anonymous block execution when executing anonymous
Apex code
C. To indicate test code so that it does not Impact Apex line count governor limits.
D. To create an additional set of governor limits during the execution of a single test class.
D. To create an additional set of governor limits during the execution of a single test class.
What must the Controller for a Visualforce page utilize to override the Standard Opportunity view button?
A. The StandardSetController to support related lists for pagination.
B. the Opportunity StandardController for pre -built functionality.
C. A callback constructor to reference the StandardController.
D.A constructor that initializes a private Opportunity variable.
B. the Opportunity StandardController for pre -built functionality.
A developer uses a before insert trigger on the Lead object to fetch the Territory__c object, where the Territory__c.PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex Data Loader to insert 10,000 Lead records. The developer has the following code block:
Line-01: for (Lead l : Trigger.new){
Line-02: if (l.PostalCode != null) {
Line-03: List terrList = [SELECT Id FROM Territory__c WHERE PostalCode__c = :l.PostalCode];
Line-04: if(terrList.size() > 0)
Line-05: l.Territory__c = terrList[0].Id;
Line-06: }
Line-07: }
Which line of code is causing the code block to fail?
A. Line-03: A SOQL query is located inside of the for loop code.
B. Line-01: Trigger:new is not valid in a before insert Trigger.
C. Line-02: A NullPointer exception is thrown if PostalCode is null.
D. Line-05: The Lead in a before insert trigger cannot be updated.
A. Line-03: A SOQL query is located inside of the for loop code.
What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?
A. Create a process with Process Builder.
B. Create a workflow rule with a field update.
C. Create a Lightning Component.
D. Create a Visualforce page.
A. Create a process with Process Builder.
Which requirement needs to be implemented by using standard workflow instead of Process Builder?
Choose 2 answers
A. Create activities at multiple intervals.
B. Send an outbound message without Apex code.
C. Copy an account address to its contacts.
D. Submit a contract for approval.
A. Create activities at multiple intervals.
B. Send an outbound message without Apex code.
An org has different Apex Classes that provide Account -related functionality.
After a new validation rule is added to the object, many of the test methods fail.
What can be done to resolve the failures and reduce the number of code changes needed for future validation rules?
Choose 2 answers:
A. Create a method that creates valid Account records, and call this method from within test methods.
B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods.
C. Create a method that performs a callout for a valid Account record, and call this method from within test methods.
D Create a method that queries for valid Account records, and call this method from within test methods.
A. Create a method that creates valid Account records, and call this method from within test methods.
B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods.
Which component is available to deploy using Metadata API?
Choose 2 answers
A. Case Layout
B. Account Layout
C. Case Feed Layout
D. ConsoleLayout
A. Case Layout
B. Account Layout
In the code below, what type does Boolean inherit from?
Boolean b= true;
A. Enum
B. Object
C. String
D. Class
B. Object
What is the preferred way to reference web content such as images, style sheets, JavaScript, and other libraries that is used in Visualforce pages?
A. By accessing the content from Chatter Files.
B. By uploading the content in the Documents tab.
C. By accessing the content from a third -party CDN.
D. By uploading the content as a Static Resource.
D. By uploading the content as a Static Resource.
A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce.
Which kind of relationship would a developer use to relate the Account to the Warehouse?
A. One -to -Many
B. Lookup
C. Master -Detail
D. Parent -Child
B. Lookup
A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object.
What happens when a user updates a record?
A. No changes are made to the data.
B. Both the Apex Trigger and Workflow Rule are fired only once.
C. The Workflow Rule is fired more than once.
D. The Apex Trigger is fired more than once.
D. The Apex Trigger is fired more than once.
What is true for a partial sandbox that is not true for a full sandbox?
Choose 2 answers:
A. More frequent refreshes.
B. Only Includes necessary metadata.
C. Use of change sets.
D. Limited to 5 GB of data.
A. More frequent refreshes.
D. Limited to 5 GB of data.
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 Triggers; After Triggers; Assignment Rules; Workflow Rules; Commit
A. Before Triggers; Validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit
Ref: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
When loading data into an organization, what can a developer do to match records to update existing records?
Choose 2 answers
A. Match an external Id Text field to a column in the imported file.
B. Match the Id field to a column in the Imported file.
C. Match the Name field to a column in the imported file.
D. Match an auto -generated Number field to a column in the imported file.
A. Match an external Id Text field to a column in the imported file.
B. Match the Id field to a column in the Imported file.
In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_value__c currency field from the CampaignMember object using a roll-up summary field called Total_estimated_value__c on Campaign.
How is the currency of the Total_estimated_value__c roll-up summary field determined?
A. The values in Campaignmember.Estimated_value__c are converted into the currency of the Campaign record and the sum is displayed using the currency on the Campaign record.
B. The values in CampaignMember.Estimated_value__c are converted into the currency on the majority of the CampaignMember records and the sum is displayed using that currency.
C. The values in CampaignMember.Estimated_value__c are summed up and the resulting Total_estimated_value__c field is displayed as a numeric field on the Campaign record.
D. The values In CampaignMember.Estimated_value__c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record.
A. The values in Campaignmember.Estimated_value__c are converted into the currency of the Campaign record and the sum is displayed using the currency on the Campaign record.
A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting, that application cannot be modified to be resubmitted to a different job posting.
What can the administrator do to associate an application with each job posting in the schema for the organization?
A. Create a lookup relationship on both objects to a junction object called Job Posting Applications.
B. Create a master-detail relationship in the Job Postings custom object to the Applications custom object.
C. Create a master-detail relationship in the Application custom object to the Job Postings custom object.
D. Create a lookup relationship in the Applications custom object to the Job Postings custom object.
C. Create a master-detail relationship in the Application custom object to the Job Postings custom object.
What is a characteristic of the Lightning Component Framework?
Choose 2 answers:
A. It has an event-driven architecture.
B. It works with existing Visualforce pages.
C. It includes responsive components.
D. It uses XML as its data format.
A. It has an event-driven architecture.
C. It includes responsive components.
What is a capability of cross-object formula fields?
Choose 3 answers
A. Formula fields can reference fields from master-detail or lookup parent relationships.
B. Formula fields can expose data the user does not have access to in a record.
C. Formula fields can be used in three roll-up summaries per object.
D. Formula fields can reference fields in a collection of records from a child relationship.
E. Formula fields can reference fields from objects that are up to 10 relationships away.
A. Formula fields can reference fields from master-detail or lookup parent relationships.
B. Formula fields can expose data the user does not have access to in a record.
E. Formula fields can reference fields from objects that are up to 10 relationships away.
Ref:
https://help.salesforce.com/HTViewHelpDoc?id=customize_cross_object.htm
A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing.
What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the Salesforce organization?
A. Apex Triggers
B. HTTP Callouts
C. Apex Controllers
D. Anonymous Blocks
D. Anonymous Blocks
Ref: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
A developer created an Apex trigger using the Developer Console and now wants to debug code
How can the developer accomplish this in the Developer Console?
A. Select the Override Log Triggers checkbox for the trigger
B. Add the user name in the Log Inspector.
C. Open the Progress tab in the Developer Console.
D. Open the logs tab in the Developer Console.
D. Open the logs tab in the Developer Console.
Which data structure is returned to a developer when performing a SOSL search?
A. A list of lists of sObjects.
B. A map of sObject types to a list of sObjects
C. A map of sObject types to a list oflists of sobjects
D. a list of sObjects.
A. A list of lists of sObjects.
How can a developer avoid exceeding governor limits when using an Apex Trigger?
choose 2 answers
A. By using a helper class that can be invoked from multiple triggers.
B. By using the Database class to handle DML transactions.
C. By using Maps to hold data from query results.
D. By performing DML transactions on lists of SObjects.
C. By using Maps to hold data from query results.
D. By performing DML transactions on lists of SObjects.
What is a correct pattern to follow when programming in Apex on a Multi-tenant platform?
A. Apex code is created in a separate environment from schema to reduce deployment errors.
B. DML is performed on one record at a time to avoid possible data concurrency issues.
C. Queries select the fewest fields and records possible to avoid exceeding governor limits.
D. Apex classes use the ‘‘with sharing” keyword to prevent access from other server tenants.
C. Queries select the fewest fields and records possible to avoid exceeding governor limits.
What should a developer working in a sandbox use to exercise a new test Class before the developer deploys that test to production?
Choose 2 answers
A. The REST API and ApexTestRun method
B. The Apex Test Execution page in Salesforce Setup.
C. The Test menu in the Developer Console.
D. The Run Tests page in Salesforce Setup.
B. The Apex Test Execution page in Salesforce Setup.
C. The Test menu in the Developer Console.