SFDC Platform Developer I, Exams of Nursing

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. correct answers D. 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.

Typology: Exams

2024/2025

Available from 06/30/2025

arsene-tip
arsene-tip šŸ‡ŗšŸ‡ø

12K documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SFDC Platform Developer I
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. correct answers D.
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. correct answers B.
A developer uses a before insert trigger on 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 Loader to insert 10000 Lead records. The developer has
the following code block:
01 for(Lead 1 : Trigger.new)
02 if(1.PostalCode null){
03 List<Territory c> terrList [SELECT Id FROM Territory c WHERE PostalCode c = : 1.
PostalCode; }
04 if(terrList.size() > 0){
05 1.Territory c terrList[0].Id;
06 }
07 }
Which line of code is causing the code block to fail?
A. 03: A SOQL query is located inside of the for loop code.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download SFDC Platform Developer I and more Exams Nursing in PDF only on Docsity!

SFDC Platform Developer I

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. correct answers D. 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. correct answers B. A developer uses a before insert trigger on 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 Loader to insert 10000 Lead records. The developer has the following code block: 01 for(Lead 1 : Trigger.new) 02 if(1.PostalCode null){ 03 List terrList [SELECT Id FROM Territory c WHERE PostalCode c = : 1. PostalCode; } 04 if(terrList.size() > 0){ 05 1.Territory c terrList[0].Id; 06 } 07 } Which line of code is causing the code block to fail? A. 03: A SOQL 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 a before insert trigger cannot be updated. correct answers A. 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. correct answers A. Which requirement needs to be implemented by using standard workflow instead of a Process Builder? (Choose 2) 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. correct answers A, B 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) 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. correct answers A, B

A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for the 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. correct answers D. What is true of a partial sandbox that is not true of a full sandbox? (Choose 2) A. More frequent refreshes. B. Only includes necessary metadata. C. Use of change sets. D. Limited to 5GB of data. correct answers A, D 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 correct answers D. 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 Toal_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 correct answers A. A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting. The 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. correct answers C. When loading data into an organization, what can a developer do to match records to update existing records? (Choose 2) 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. correct answers A, B What is a characteristic of the Lightning Component Framework? (Choose 2) A. It has an event driven architecture. B. It works with existing Visualforce pages.

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. correct answers A. How can a developer avoid exceeding governor limits when using an Apex Trigger? (Choose 2) 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. correct answers C, D What is a correct pattern to follow when programming in Apex on a multitenant 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. correct answers C. What should a developer working in a sandbox use to exercise a new test Class before the developer deploys that test production? (Choose 2) 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. correct answers B, C A company that uses a Custom object to track candidates 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. correct answers D. What is the accurate statement about With Sharing keyword? (Choose 2) A. Inner class do not inherit the sharing setting from the container class. B. Both inner and outer class can be declared as With Sharing. C. Either inner class or outer classes can be declared as With sharing but not both. D. Inner class inherit the sharing setting from the container class. correct answers A, B How can a developer refer to or instantiate a PageReference in Apex? (Choose 2) A. By using a PageReference with a partial or full URL. B. By using the 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. correct answers A, B Which standard field needs to be populated when a developer inserts new Contact records programmatically? A. AccountId B. Name C. LastName D. FirstName correct answers C. What is the minimum log level needed to see user generated debug statements? A. DEBUG B. FINE

To which primitive data type in Apex is a currency field automatically assigned? A. Integer B. Decimal C. Double D. Currency correct answers B. Which resource can be included in a Lightning Component bundle? (Choose 2) A. Apex class B. Adobe Flash C. Javascript D. Documentation correct answers C, D A custom exception "RecordNotFoundException" is defined by the following block of code: Public class RecordNotFoundException extends Exception() Which statement can a developer use to throw an exception? (Choose 2) A. Throw new RecordNotFoundException("Problem Occurred"); B. Throw new RecordNotFoundException(); C. Throw RecordNotFoundException("Problem Occurred"); D. Throw RecordNotFoundException(); correct answers A, B When creating unit tests in Apex, which statement is accurate? A. Unit tests with multiple methods result in all methods failing every time on 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 Assert statements that do not increase code coverage contribute important feedback in unit tests. correct answers D. Public class MyController1 { public String myString; Public String getMyString(){Return 'getMyString';} Public string getStringMethod1(){Return myString;} Public string getStringMethod2(){If(myString==null){myString='method2';}return mystring;} } <apex:page controller="MyController1"> {!myString}, {!stringMethod1}, {!StringMethod2}, {!myString} </apex:page> What does the user see when accessing the custom page? A. getMyString B. Method C. Method2, getMyString D. getMyString, Method2, getMyString correct answers B. What is a valid Apex statement? A. Map conMap = (SELECT Name FROM Contact); B. Account() acctList = new List {new Account()} C. Integer w, x, y = 123, z = 'abc' D. Private static constant Double rate = 775 correct answers B. 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 ExtendedController(ApexPages.StandardController cntrl){} B. ApexPages.currentPage().getParameters() put(input, 'TestValue') C. Test.setCurrentPage(PageRef) D. String nextPage = controller.save().getURL(); correct answers D.

Which code represents the Controller in MVC architecture on the Force.com platform (Choose 2) 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. correct answers B, C A developer needs to provide a Visualforce page that lets users enter Product specific details during a Sales cycle. How can this be accomplished? (Choose 2) A. Download a Managed Package from the AppExchange that provides a custom Visualforce page to modify. B. Create a new Visualforce page and an Apex controller to provide Product data entry. C. Copy the standard page and then make a Visualforce page for product data entry. D. Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify. correct answers B, D A developer writes a before insert trigger. How can the developer access the incoming records in the trigger body? A. By accessing the Trigger.new context variable. B. By accessing the Trigger.newRecords context variable. C. By accessing the Trigger.newMap context variable. D. By accessing the Tripper.newList context variable. correct answers A. 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 myAccount = new Account(Name='MyAccount' + x); try{insert myAccount;} catch (Exception ex){ System.Debug(ex); } } How many accounts are in the org after this code is run?

A. 101

B. 100

C. 102

D. 252 correct answers B. The Review__c object have a lookup relationship to the Job_Application__c object. The Job_Application__c object has a master detail relationship up to the Position__c object. The relationship is based on the auto populated defaults. What is the recommended way to display field data from the related Review__c records a Visualforce page for a single Position__c record? A. Utilize the Standard Controller for Position_c and cross object Formula Fields on the Job_Application c object to display Review_c data. B. Utilize the Standard Controller for Position_c and a Controller Extension to query for Review _ C data. C. Utilize the Standard Controller for Position_c and expression syntax in the Page to display related Review_c through me Job_Applicacion_c inject. D. Utilize the Standard Controller for Position_c and cross object formula Fields on the Review_c object to display Review_c data. correct answers D. What is a capability of the Force.com IDE? (Choose 2) A. Roll back deployments. B. Run Apex tests. C. Download debug logs. D. Edit metadata components. correct answers B, D Which code segment can be used to control when the dowork() method is called? A. for (triggerIsRunning t: trigger.new) {dowork();} B. if(trigger.Isrunning) dowork(); C. for (trigger.IsInsert t: trigger.new) {dowork();} D. if(trigger.IsInsert) dowork(); correct answers D.

A. The Account should have a Lookup relationship to the Invoice. B. The Invoice should have a Master Detail relationship to the Account. C. The Account should have a Master Detail relationship to the Invoice. D. The Invoice should have a Lookup relationship to the Account. correct answers B. What is a valid source and destination pair that can send or receive change sets? (Choose 2) A. Sandbox to production. B. Developer edition to sandbox. C. Developer edition to production. D. Sandbox to sandbox. correct answers A, D A developer needs to create records for the object Property__c. The developer creates the following code block: 01 List propertiesToCreate = helperClass.createProperties(); 02 try { 03 04 } catch (Exception exp) { 05 //Exception handling 06 Which line of code would the developer insert at line 03 to ensure that at least some records are created, even if a records have errors and fail to be created? A. Database.insert(propertiesToCreate,System.ALLOW_PARTIAL); B. insert propertiesToCreate, C. Database.insert(propertiesToCreate,false); D. Database.insert(propertiesToCreate), correct answers C. When the number of records in a recordset is unknown, which control statement should a developer use to implement set of code that executes for every record in the recordset, without performing a .size() or .length() method call? A. For (init_stmt, exit_condition; increment_stmt) { }

B. Do { ) While (Condition) C. For (variable : list_or_set) { D. While (Condition) { ...} correct answers C. What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which then results in hitting a governor limit? A. Any changes up to the error are saved. B. Any changes up to the error are rolled back. C. All changes before a savepoint are saved. D. All changes are saved in the first Apex class. correct answers B. A developer has the following code block: public class PaymentTax { public static decimal SalesTax = 0.0875; } trigger OpportunityLineItemTrigger on OpportunityLineltem (before insert, before update) { PaymentTax PayTax = new PaymentTax(); decimal ProductTax = ProductCost * XXXXXXXXXXX; } To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger? A. SalesTax B. PayTax.SalesTax C. PaymentTax.SalesTax D. OpportunityLineItemTrigger.SalesTax correct answers C. On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL? A. Use the constructor method for the controller. B. Use the $Action.View method in the Visualforce page.

B. Debug Statement. C. Namespace. D. Time. correct answers C, D 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. Create data for testing. Execute runAllTests(). Verify that the results are correct. C. Create data for testing. 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. correct answers C. Which declarative method helps ensure quality data? (Choose 3) A. Exception handling. B. Workflow alerts. C. Validation rules. D. Lookup filters. E. Page layouts. correct answers C, D, E What is an accurate constructor for a custom controller named "MyController"? A. public MyController() { account = new Account();} B. public MyController(SObject obj) { account = (Account) obj;} C. public MyController(List objects) { accounts = (List)objects;} D. public MyController(ApexPages.StandardController stdController) {account = (Account)stdController.getRecord();} correct answers A.

A company wants a recruiting app that models candidates and interviews; displays the total number of interviews 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) 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. correct answers A, B What is a good practice for a developer to follow when writing a trigger? (Choose 2) A. Using the Map data structure to hold query results by ID. B. Using @future methods to perform DML operations. C. Using the set data structure to ensure distinct records. D. Using synchronous callouts to call external systems correct answers A, C Which code block returns the ListView of an Account object using the following debug statement? system. debug (controller. getListViewOptions ( ) ) ; A. ApexPages.StandardSetController controller = new ApexPages.StandardSetController([SELECT Id FROM Account LIMIT 1]); B. ApexPages.StandardController controller = new ApexPages.StandardController(Database.getQueryLocator('select Id from Account Limit 1'); C. ApexPages.StandardController controller = new ApexPages StandardController ( [SELECT Id FROM Account LIMIT 1)); D. ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.getQueryLocator('select Id from Account Limit 1'); correct answers D. Which data type or collection of data types can SOQL statements populate or evaluate to? (Choose 3)