Salesforce Dev Platform 1 Dump Flashcards
To pass the test
- 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 Visulforce page utilized 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 initialized 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.PostalCode__c matches the Lead.PostalCode. The code fails when the developer uses the Apex Data Loader to insert 10000 Lead records. The developer has the following code block:
for(Lead l : Tigger.new) { if(l.PostalCode != null) { List< Territory\_\_c> terrList = [ SELECT Id FROM Territory\_\_c where PostalCode\_\_c =: lo.PostalCode ]; if(terrList.size() > 0) { l.Territory\_\_c = terrList[0].id; } } }
Which line of code is causing the code block to fail?
A. 03: A SQOL query is located inside of the for loop code.
B. 01: Trigger.new is not valid in a before insert Trigger.
C. 02: A NullPointer exception is thrown if PostalCode is null.
D. 05: The Lead in the before insert trigger cannot be updated.
A. 03: A SQOL query is located inside of the for loop code.
- What would a developer do to update a picklist field on a related Opportunity records when a modification to the associated Account record is detected?
A. Create a process with a 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 a process builder.
- Which requirement needs to be implemented using standard workflow instead of Process Builder? Choose 2 answers
A. Create activities at multiple intervals
B. Send 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 outbound message without Apex code
- An org has a different Apex classes that provide Account-related functionality. After a new validation rule is added to the Account object, many of the test methods fail.
What can be done to resolve failures and reduce the number of code changes needed in 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 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 within test methods.
D. Create a method that queries for valid Account records, and call this method 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 static resource, and call this method within test methods.
7. Which component is available to deploy using Metadata API? Choose 2 answers. A. Case Layout B. Account Layout C. Case Feed Layout D. Console Layout
A. Case Layout
B. Account Layout
8. 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 of accessing web content such as images, stylesheets, 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 parent Account in Salesforce.
Which kind of relationship would the 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 trigger exists for the object. What happens when a user updates a record?
A. No changes are made to the data.
B. Both Apex Trigger and Workflow Rule are fired only once.
C. The workflow Rules is fired more than once.
D. The Apex Trigger is fired more than once.
D. The Apex Trigger is fired more than once.
12. What is true of a partial sandbox that is not true of a full sandbox? A. More frequent refreshes B. Only includes necessary meta data 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
- When loading data in to 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. Matched the Name field to a column in the imported file
D. Matches 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 sum of the Estimated_value__c currency field from the CampaignMember object using a roll-up summary field called Total_Estimate_Value__c field on Campaign. How is the currency of the Total_Estimate_Value__c roll-up summary field determined?
A. The values in the 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 the CampaignMember. Estimated_value__c are converted into the currency on the majority of CampaignMember records and the sum is displayed using that currency 4
C. The values in the 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 the 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 the 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 Container by submitting a single application per job posting. Once an application submitted for a 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 Posting custom object to the Applications custom object.
C. Create a master-detail relationship in the Applications custom object to the Job Posting custom object.
D. Create a lookup relationship in the Applications custom object to the Job Posting custom object.
C. Create a master-detail relationship in the Applications custom object to the Job Posting 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 field?
Choose 3 answers.
A. Formula fields can reference fields from mater-detail or lookup parent relationships
B. Formula fields can expose data the user does not have access to in the 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 object that are up to 10 relationships away
A. Formula fields can reference fields from mater-detail or lookup parent relationships
B. Formula fields can expose data the user does not have access to in the record
E. Formula fields can reference fields from object that are up to 10 relationships away
- A developer has a block of code that omits any statements that indicate whether the 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 Trigger
B. Http Callout
C. Apex Controllers
D. Anonymous Blocks
D. Anonymous Blocks
- A developer creates 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 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 of lists 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 the correct pattern to follow when programming in Apex on multi-tenant platform?
A. Apex code is created in a separate environment from schema to reduce the deployment errors.
B. DML is performed on one record at a time to avoid possible data concurrency issues.
C. Queries select the fewer fields and records possible to avoid exceeding governor limits.
D. Apex classes use the “with sharing” keyword to prevent access from server tenants
C. Queries select the fewer 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 class 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 the Salesforce Setup
B. The Apex Test Execution page in Salesforce Setup
C. The Test menu in the Developer Console
- A company that uses a custom object to track candidate would like to send candidate information automatically to a
third-party human resource system when a candidate is hired.
What can a developer do to accomplish this task?
A. Create an escalation rule to the hiring manager
B. Create an auto response rule to the candidate
C. Create a Process Builder with an outbound message action
D. Create a workflow rule with an outbound message action
D. Create a workflow rule with an outbound message action
- What is accurate statement about with sharing keyword? Choose 2 answers
A. Inner classes do not inherit the sharing settings from the container class.
B. Both inner and outer classes can be declared as with sharing.
C. Either inner or outer classes can be declared as with sharing, but not both.
D. Inner classes inherit the sharing settings from the container class.
A. Inner classes do not inherit the sharing settings from the container class.
B. Both inner and outer classes can be declared as with sharing.
- How can a developer refer to, or instantiate a PageReference in Apex? Choose 2 answers
A. By using a PageReference with a partial or full URL
B. By using Page object and a Visualforce page name.
C. By using the ApexPages.Page() method with a Visualforce page name.
D. By using the PageReference.Page() method with a partial or full URL.
A. By using a PageReference with a partial or full URL
B. By using Page object and a Visualforce page name.
28. Which standard field needs to be populated when a developer inserts a new Contact records programmatically? A. AccountId B. Name C. LastName D. FirstName
C. LastName
29. What is minimum log level needed to see user-generated debug statements? A. DEBUG B. FINE C. INFO D. WARN
A. DEBUG
- A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of
the new Apex extension.
Change set deployment to production fails with the test coverage warning: “Average test coverage across all Apex
classes and Triggers is 74%, at least 75% test coverage is required.”
What can the developer do to successfully deploy the new Visualforce page and the extension?
A. Create test classes to exercise the Visualforce page markup.
B. Select “Disable Parallel Apex Testing” to run all the tests.
C. Add test methods to existing test classes from previous deployments.
D. Select “Fast Deployment” to bypass running all the tests.
C. Add test methods to existing test classes from previous deployments.
- A developer needs to automatically populate the Reports To field in a Contact record on the values of the related
Account and Department fields in the Contact record.
Which type of trigger would the developer create? Choose 2 answers
A. before update
B. after insert
C. before insert
D. after update
A. before update
C. before insert
- A developer is creating an application to track engine and their parts. An individual part can be used in different types
of engines.
What data model should be used to track the data to prevent orphan records?
A. Create a junction object to relate many engine to many parts through a master-detail relationship
B. Create a master-detail relationship to represent the one-to-many model of engine parts.
C. Create a lookup relationship to represent how each part relates to the parent engine object.
D. Create a junction object to relate many engines to many parts through a lookup relationship
A. Create a junction object to relate many engine to many parts through a master-detail relationship
33. To which data type in Apex a currency field automatically assigned? A. Integer B. Decimal C. Double D. Currency
B. Decimal
34. Which resource can be included in a Lightning Component bundle? A. Apex class B. Adobe Flash C. Javascript D. Documentation
C. Javascript
D. Documentation
- A custom exception names “RecordNotFoundException” is defined by the following code block.
public class RecordNotFoundException extends Exception {}
Which statement can a developer use to throw the custom exception?
Choose 2 answers
A. throw new RecordNotFoundException(“Problem occurred”);
B. throw new RecordNotFoundException();
C. thow RecordNotFoundException(“Problem occurred”);
D. throw RecordNotFoundException();
A. throw new RecordNotFoundException(“Problem occurred”); B. throw new RecordNotFoundException();
- When creating unit tests in Apex, which statement is accurate?
A. Unit tests with multiple methods result in all methods falling every time one method fails.
B. Increased test coverage requires large test classes with many lines of code in one method.
C. Triggers do not require any unit tests in order to deploy them from sandbox to production.
D. System Asset statements that do not increase code coverage contribute important feedback in unit tests.
D. System Asset statements that do not increase code coverage contribute important feedback in unit tests.
- What is a valid Apex statement?
A. Map conMap = [ SELECT name FROM Contact ];
B. Account[] accList = new List{new Account()};
C. Integer w, x, y = 123, z = ‘abc’;
D. private static constant Double rate = 7.75;
B. Account[] accList = new List{new Account()};
- A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which statement is unnecessary inside the unit test for the custom controller?
A. public ExtendController(ApexPages.StandardController cntrl) {}
B. ApexPages.currentPage().getParameters().put(‘input’, ’TestValue’);
C. Test.setCurrentPage(pageref);
D. String nextPage = controller.save().getUrl();
A. public ExtendController(ApexPages.StandardController cntrl) {}
- A developer wants to display all of the available record types for a Case object. The developer also wants to display
the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce
page.
Which action can the developer perform to get the record types and picklist values in the controller?
Choose 2 answers.
A. Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues();
B. Use Schema.RecordTypeInfo retunred by Case.SObjectType.getDescribe().getRecordTypeInfos();
C. Use SOQL to query records in the org to get all the RecordType values available for Case.
D. Use SOSL to query Case records in the org to get all values for the Status picklist field.
A. Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues();
B. Use Schema.RecordTypeInfo retunred by Case.SObjectType.getDescribe().getRecordTypeInfos();
- An sObject named Application__c has a lookup relationship to another sObject named Position__c.
Both Application__c and Position__c have a picklist field named Status__c.
When the Status__c field on Position__c is updated, the Status__c fields on Application__c needs to be populated
automatically with the same value, and execute a workflow rule on Application__c.
How can a developer accomplish this?
A. By changing the Application__c.Status__c into a roll-up summary field.
B. By changing the Application__c.Status__c into a formula field.
C. By using an Apex trigger with a DML operation
D. By configuring a cross-object field update with a workflow.
B. By changing the Application__c.Status__c into a formula field.
42. A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created. When will the email be sent? A. Before Trigger execution B. After committing to database. C. Before committing to database. D. After Trigger Execution
B. After committing to database.
- Which type of code represents the Controller in MVC architecture on the Force.com platform? Choose 2 answers.
A. JavaScript that is used to make a menu item display itself.
B. StandardController system methods that are referenced by Visualforce.
C. Custom Apex and JavaScript code that is used to manipulate data.
D. A static resource that contains CSS and images.
B. StandardController system methods that are referenced by Visualforce.
C. Custom Apex and JavaScript code that is used to manipulate data.