Salesforce Certified Platform Developer I Exam Questions PDF

Summary

This document contains a set of practice exam questions for the Salesforce Certified Platform Developer I exam. The questions cover various aspects of Salesforce development, including flows, Apex triggers, and Lightning components.

Full Transcript

## Salesforce Certified Platform Developer I Exam Questions **1 of 65.** A Salesforce administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura component. Which tag should a developer use to display the flow in the component? - **lightning:...

## Salesforce Certified Platform Developer I Exam Questions **1 of 65.** A Salesforce administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura component. Which tag should a developer use to display the flow in the component? - **lightning: flow** - lightning-flow - aura-flow - aura:flow **2 of 65.** A developer is alerted to an issue with a custom Apex trigger that is causing records to be duplicated. What is the most appropriate debugging approach to troubleshoot the issue? - Review the Historical Event logs to identify the source of the issue. - **Add system.debug statements to the code to track the execution flow and identify the issue.** - Use the Apex Interactive Debugger to step through the code and identify the issue. - Disable the trigger in production and test to see if the issue still occurs. **9 of 65.** Managers at Universal Containers want to ensure that only decommissioned containers are able to be deleted in the system. To meet the business requirement a Salesforce developer adds "Decommissioned" as a picklist value for the `Status` custom field within the `Container` object. Which two approaches could a developer use to enforce only Container records with a status of "Decommissioned" can be deleted? - **Apex trigger** - **Validation rule** - Before record-triggered flow - After record-triggered flow **16 of 65.** Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation. What would be the best solution for this requirement? - **Use a before-save Apex trigger on the Lead object to validate the email address and display an error message if it is invalid** - Submit a REST API Callout with a JSON payload and validate the fields on a third party system - Use an Approval Process to enforce the completion of a valid email address using an outbound message action. - Use a custom Lightning Web component to make a callout to validate the fields on a third party system. **17 of 65.** A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations. Which type of Salesforce orgs should they use for their development? - **Scratch orgs** - Developer sandboxes - Full Copy sandboxes - Developer orgs **21 of 65.** A developer needs to allow users to complete a form on an Account record that will create a record for a custom object. The form needs to display different fields depending on the user's job role. The functionality should only be available to a small group of users. Which three things should the developer do to satisfy these requirements? - **Add a Dynamic Action to the Users' assigned Page Layouts.** - **Create a Custom Permission for the users.** - **Create a Dynamic Form.** - Create a Lightning web component. - Add a Dynamic Action to the Account Record Page. **22 of 65.** A developer needs to prevent the creation of `Request_c` records when certain conditions exist in the system. A `RequestLogic` class exists that checks the conditions. What is the correct implementation? - **trigger RequestTrigger on Request_c (before insert) {** ** RequestLogic.validateRecords(trigger.new);** ** }** - trigger RequestTrigger on Request_c (after insert) { RequestLogic.validateRecords (trigger.new); } - trigger RequestTrigger on Request_c (before insert) { if (Requestlogic.isValid (Request_1) Request.addError('Your request cannot be created at this time.'); } - trigger RequestTrigger on Request_c (after insert) { if (RequestLogic.isValid (Request_c) Request.addError('Your request cannot be created at this time.'); } **29 of 65.** A company decides to implement a new process where every time an Opportunity is created, a follow-up Task should be created and assigned to the Opportunity Owner. What is the most efficient way for a developer to implement this? - **Record-triggered flow on Opportunity** - Apex trigger on Task - Task actions - Auto-launched flow on Task **36 of 65.** A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record. How can the developer find the current user's default record type? - **Use the schema.userInfo.Opportunity.getDefaultRecordType() method.** - Create the opportunity and check the opportunity.recordType, which will have the record ID of the current user's default record type, before inserting. - Query the Profile where the ID equals userinfo.getProfileID() and then use the profile. Opportunity.getDefaultRecordType() method. - Use Opportunity.sobjectType.getDescribe().getRecordTypeInfos () to get a list of record types, and iterate through them until isDefaultRecordTypeMapping() is true. **37 of 65.** The Account object in an organization has a master-detail relationship to a child object called Branch. The following automations exist: * Roll-up summary fields * Custom validation rules * Duplicate rules A developer created a trigger on the Account object. Which two things should the developer consider while testing the trigger code? - **The trigger may fire multiple times during a transaction.** - **Duplicate rules are executed once all DML operations commit to the database.** - Rollup summary fields can cause the parent record to go through Save. - The validation rules will cause the trigger to fire again. **50 of 65.** A `PrimaryId_c` custom field exists on the `Candidate_c` custom object. The field is used to store each candidate's id number and is marked as Unique in the schema definition. As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's primary id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should the developer implement to streamline the data upload? - **Update the `PrimaryId_c` field definition to mark it as an External Id.** - Upload the CSV into a custom object related to `candidate_c`. - Create a before insert trigger to correctly map the records. - Create a before save flow to correctly map the records. **51 of 65.** A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes. The following code is executed in the Developer Console using the Execute Anonymous window: ```java Account myAccount = new Account (Name = 'MyAccount'); insert myAccount; Integer x = 1; List<Account> newAccounts = new List<Account>(); do { Account acct = new Account (Name = 'New Account ' + x++); newAccounts.add(acct); } while (x < 10); ``` How many total accounts will be in the org after this code is executed? - **16** - 5 - 6 - 10 - 15 **63 of 65.** A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book? - **Use Test.getStandardPriceBookId() to get the standard price book ID.** - Use `@TestVisible` to allow the test method to see the standard price book. - Use `Test.loadData()` and a static resource to load a standard price book. - Use `BISTest (SeeAllData=true)` and delete the existing standard price book. **64 of 65.** A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a `Salary_c` custom field. What should the developer use, along with a `lightning-record-edit-form`, so that the `salary_c` field functions as a currency input, and is only viewable and editable by users that have the correct field level permissions on `Salary_c`? - `<lightning-input-field field-name="salary_c"></lightning-input-field>` - `<lightning-input-currency value="Salary_c"></lightning-input-currency>` - `<lightning-formatted-number value="salary_c" format-style="currency"></lightning-formatted-number>` - `<lightning-input type="number" value="salary_c" formatter="currency"></lightning-input>` **3 of 65.** What is the result of the following code snippet? ```java public void doWork (Account acct) { for (Integer i = 0; i <= 200; i++) { insert acct; } ``` - **201 Accounts are inserted.** - 0 Accounts are inserted. - 1 Account is inserted. - 200 Accounts are inserted. **4 of 65.** If Apex code executes inside the execute() method of an Apex class when implementing the `Batchable` interface, which two statements are true regarding governor limits? - **The Apex governor limits are reset for each iteration of the execute() method.** - **The Apex governor limits will use the asynchronous limit levels.** - The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction. - The Apex governor limits are omitted while calling the constructor of the Apex class. **5 of 65.** A developer must perform a complex SOQL query that joins two objects in a Lightning component. How can the Lightning Component execute the query? - **Invoke an Apex class with the method annotated as `@AuraEnabled` to perform the query.** - Write the query in a custom Lightning web component wrapper and invoke from the Lightning component. - Use the Salesforce Streaming API to perform the SOQL query. - Create a flow to execute the query and invoke from the Lightning component. **6 of 65.** Which two operations affect the number of times a trigger can fire? - **Criteria-based sharing calculations** - **Roll-up summary fields** - Email messages - After-save record-triggered flow **7 of 65.** Which two are best practices when it comes to Aura Component and application event handling? - **Try to use application events as opposed to component events.** - **Handle low-level events in the event handler and re-fire them as higher-level events.** - Reuse the event logic in a component bundle, by putting the logic in the helper. - Use component events to communicate actions that should be handled at the application level. **8 of 65.** What are three considerations when using the `@InvocableMethod` annotation in Apex? - **A method using the `@InvocableMethod` annotation can have multiple input parameters.** - **A method using the `@InvocableMethod` annotation must be declared as static.** - **A method using the `@InvocableMethod` annotation must define a return value.** - Only one method using the `@InvocableMethod` annotation can be defined per Apex class. - A method using the `@InvocableMethod` annotation can be declared as `Public` or `Global`. **10 of 65.** Which two settings must be defined in order to update a record of a junction object? - **Read/Write access on the primary relationship** - **Read/Write access on the secondary relationship** - Read/Write access on the junction object - Read access on the primary relationship **11 of 65.** A developer wrote Apex code that calls out to an external system using REST API. How should a developer write the test to prove the code is working as intended? - **Write a class that extends `HTTPCalloutMock`.** - Write a class that implements `HTTPCalloutMock`. - Write a class that implements `webserviceMock`. - Write a class that extends `WebServiceMock`. **12 of 65.** Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation. What are two characteristics of declarative development over programmatic customization? - **Declarative development can be done using the Setup menu.** - **Declarative development does not require Apex test classes.** - Declarative development has higher design limits and query limits. - Declarative code logic does not require maintenance or review. **13 of 65.** How is a controller and extension specified for a custom object named "Notice" on a Visualforce page? - `<apex:page controller="Notice_c" extensions="myControllerExtension">` - `<apex:page standardController="Notice_c" extensions="myControllerExtension">` - `<apex:page Notice extends="myControllerExtension">` - `<apex:page controllers="Notice_c, myControllerExtension">` **14 of 65.** How does the Lightning Component framework help developers implement solutions faster? - **By providing an Agile process with default steps** - By providing device-awareness for mobile and desktops - By providing code review standards and processes - By providing change history and version control **15 of 65.** Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records. Which Visualforce feature supports this requirement? - **Standard Controller with Custom List Controller extension** - Controller Extension and `<apex: listButton>` tag - Custom List Controller with `recordsetVar` page attribute - Standard controller and the `recordsetvar` page attribute **18 of 65.** A team of many developers work in their own individual orgs that have the same configuration as the production org. Which type of org is best suited for this scenario? - **Full Sandbox** - Developer Sandbox - Developer Edition - Partner Developer Edition **19 of 65.** A developer must provide custom user interfaces when users edit a Contact in either Salesforce Classic or Lightning Experience. What should the developer use to override the Contact's Edit button and provide this functionality? - **A Visualforce page in Salesforce Classic and a Lightning page in Lightning Experience** - A Lightning component in Salesforce Classic and a Lightning component in Lightning Experience - A Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience - A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience **20 of 65.** Which code statement includes an Apex method named `updateAccounts` in the class `AccountController` for use in a Lightning web component? - `import updateAccounts from '@salesforce/apex/AccountController.updateAccounts';` - `import updateAccounts from 'AccountController';` - `import updateAccounts from '@salesforce/apex/AccountController';` - `import updateAccounts from 'AccountController.updateAccounts';` **23 of 65.** For which three items can a trace flag be configured? - **Apex Class** - **Flow** - **Apex Trigger** - User - Visualforce * 24 of 65.** Which exception type cannot be caught? - **NoAccessException** - CalloutException - A custom exception - LimitException **25 of 65.** What should a developer do to check the code coverage of a class after running all tests? - **View the code coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests tab.** - View the Class Test Percentage tab on the Apex Class list view in Salesforce Setup. - View the Code Coverage column in the list view on the Apex Classes page. - Select and run the class on the Apex Test Execution page in the Developer Console. **26 of 65.** A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required." What should the developer do to successfully deploy the new Apex trigger and helper class? - **Create a test class and methods to cover the Apex Trigger.** - Increase the test class coverage on the helper class. - Run the tests using the `Run All Tests` method. - Remove the failing test methods from the test class. **27 of 65.** What are three capabilities of the `<ltng: require>` tag when loading JavaScript resources in Aura components? - **Loading scripts in parallel** - **Loading files from Documents** - **Specifying loading order** - One-time loading for duplicate scripts - Loading externally hosted scripts **28 of 65.** A custom picklist field, `Food_Preference_c`, exists on a custom object. The picklist contains the following options: `Vegan`, `Kosher`, `No Preference`. The developer must ensure a value is populated every time a record is created or updated. What is the optimal way to ensure a value is selected every time a record is saved? - **Mark the field as Required on the object's page layout.** - Write an Apex trigger to ensure a value is selected. - Set "Use the first value in the list as the default value" to `True`. - Mark the field as Required on the field definition. **30 of 65.** A developer is tasked to perform a security review of the `ContactSearch` Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat: ```java List<Contact> performSearch (String lastName) { return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like '+lastName+'%'); } ``` What are two ways the developer can update the method to prevent a SOQL injection attack? - **Use variable binding and replace the dynamic query with a static SOQL.** - **Use the `escapesinglesQuotes` method to sanitize the parameter before its use.** - Use the `@Readonly` annotation and the `with sharing` keyword on the class. - Use a regular expression expression on the parameter to remove special characters. **31 of 65.** What are two benefits of using External IDs? - **An External ID field can be used to reference an ID from another external system.** - **An External ID is indexed and can improve the performance of SOQL queries.** - An External ID can be a formula field to help create a unique key from two fields in Salesforce. - An External ID can be used with Salesforce Mobile to make external data visible. **32 of 65.** What are two characteristics related to formulas? - **Formulas are calculated at runtime and are not stored in the database.** - **Fields that are used in a formula field can be deleted or edited without editing the formula.** - Formulas can reference themselves. - Formulas can reference values in related objects. **33 of 65.** What should a developer use to script the deployment and unit test execution as part of continuous integration? - **Salesforce CLI** - Execute Anonymous - VS Code - Developer Console **34 of 65.** What are two considerations for deploying from a sandbox to production? - **All triggers must have at least one line of test coverage.** - **Unit tests must have calls to the `System.assert` method.** - Should deploy during business hours to ensure feedback can be quickly addressed. - At least 75% of Apex code must be covered by unit tests. **35 of 65.** What is the result of the following code? ```java Account a = new Account(); Database.insert(a, false); ``` - **The record will be created and a message will be in the debug log.** - The record will be created and no error will be reported. - The record will not be created and an exception will be thrown. - The record will not be created and no error will be reported. **38 of 65.** 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 three statements are useful inside the unit test to effectively test the custom controller? - **`ApexPages.currentPage().getParameters().put('input', 'TestValue');`** - **`Test.setCurrentPage (pageRef);`** - **`String nextPage = controller.save().getUrl();`** - `insert pageRef;` - `public ExtendedController (ApexPages.StandardController cntrl) { }` **39 of 65.** A developer is designing a new application on the Salesforce Platform and wants to ensure it can support multiple tenants effectively. Which design framework should the developer consider to ensure scalability and maintainability? - **Flux (view, action, dispatcher, and store)** - Waterfall Model - Model-View-Controller (MVC) - Agile Development **40 of 65.** A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, `Pricing_Structure_c`. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records. Which two approaches can the developer use to ensure `Pricing_Structure_c` records are available when the test class is executed? - **Use the `@TestVisible (SeeAllData=true)` annotation.** - **Use the `Test.loadTest()` method.** - Use a Test Data Factory class. - Use `without sharing` on the class declaration. **41 of 65.** Given the following Apex statement: ```java Account myAccount = [SELECT Id, Name FROM Account]; ``` What occurs when more than one Account is returned by the SOQL query? - **The first Account returned is assigned to `myAccount`.** - The query fails and an error is written to the debug log. - An unhandled exception is thrown and the code terminates. - The variable, `myaccount`, is automatically cast to the `List` data type. **42 of 65.** An org has an existing flow that edits an Opportunity with an Update Records element. A developer must update the flow to also create a Contact and store the created Contact's ID on the Opportunity. Which update must the developer make in the flow? - **Add a new Create Records element.** - Add a new Update Records element. - Add a new Get Records element. - Add a new Roll Back Records element. **43 of 65.** Universal Containers wants to back up all of the data and attachments in its Salesforce org once a month. Which approach should a developer use to meet this requirement? - **Define a Data Export scheduled job.** - Use the Data Loader command line. - Create a Schedulable Apex class. - Schedule a report. **44 of 65.** What should a developer use to fix a Lightning web component bug in a sandbox? - **VS Code** - Developer Console - Force.com IDE - Execute Anonymous **45 of 65.** A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable. Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions? - `accountRec.isDeletable()` - `accountRec.sobjectType.isDeletable()` - `schema.sobjectType.Account.isDeletable()` - `Account.isDeletable()` **46 of 65.** A lead developer creates an Apex interface called `Laptop`. Consider the following code snippet: ```java public class SilverLaptop{ //code implementation } ``` How can a developer use the `Laptop` interface within the `SilverLaptop` class? - `public class SilverLaptop implements Laptop` - `public class SilverLaptop extends Laptop` - `@Extends (class="Laptop")` `public class SilverLaptop` - `@Interface (class="Laptop")` `public class SilverLaptop` **47 of 65.** A lead developer creates a virtual class called "OrderRequest". Consider the following code snippet: ```java public class CustomerOrder { //code implementation } ``` How can a developer use the `OrderRequest` class within the `CustomerOrder` class? - `public class CustomerOrder extends OrderRequest` - `@Extends (class="OrderRequest")` `public class CustomerOrder` - `@Implements (class="OrderRequest")` `public class CustomerOrder` - `public class CustomerOrder implements Order` **48 of 65.** What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers"? - `SELECT Lead.id, Lead.Name, Account. Id, Account. Name, Contact. Id, Contact. Name FROM Lead, Account, Contact WHERE CompanyName = 'Universal Containers'` - `FIND 'Universal Containers' IN CompanyName Fields RETURNING lead(id, name), account (id, name), contact (id, name)` - `FIND 'Universal Containers' IN Name Fields RETURNING lead(id, name), account (id, name), contact (id, name)` - `SELECT lead(id, name), account (id, name), contact (id, name) FROM Lead, Account, Contact WHERE Name = 'Universal Containers'` **49 of 65.** An Opportunity needs to have an amount rolled up from a custom object that is **not** in a master-detail relationship. How can this be achieved? - **Write a trigger on the Opportunity object and use an aggregate function to sum the amount for all related child objects under the Opportunity.** - Write a trigger on the child object and use an aggregate function to sum the amount for all related child objects under the Opportunity. - Use the Streaming API to create real-time roll-up summaries. - Use the Metadata API to create real-time roll-up summaries. **52 of 65.** What are two considerations for running a flow in debug mode? - **Callouts to external systems are not executed when debugging a flow.** - **DML operations will be rolled back when the debugging ends.** - Input variables of type `record` cannot be passed into the flow. - Clicking Pause or executing a Pause element closes the flow and ends debugging. **53 of 65.** A credit card company needs to implement the functionality for a service agent to process damaged or stolen credit cards. When the customers call in, the service agent must gather many pieces of information. A developer is tasked to implement this functionality. What should the developer use to satisfy this requirement in the most efficient manner? - **Screen-based flow** - Approval process - Lightning Component - Apex trigger **54 of 65.** A custom Visualforce controller calls the `ApexPages.addMessage()` method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message? - `<apex:pageMessages/>` - `<apex:message for="info"/>` - `<apex:pageMessage severity="info" />` - `<apex:facet name="messages" />` **55 of 65.** Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event? - `fire()` - `fireEvent()` - `registerEvent()` - `emit()` **56 of 65.** A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org. Which tool should the developer use to troubleshoot query performance? - **Developer Console** - Setup Menu - AppExchange - Visual Studio Code IDE **57 of 65.** A developer considers the following snippet of code: ```java Boolean isOK; integer x; String theString = 'Hello'; if (isOK == false && theString == 'Hello') { x = 1; } else if (isOK == true && theString == 'Hello') { x = 2; } else if (is0K != null && theString == 'Hello') { x = 3; } else { x = 4; } ``` Based on this code, what is the value of x? - 4 - 1 - 2 - 3 **58 of 65.** What does the Lightning Component framework provide to developers? - **Prebuilt components that can be reused** - Templates to create custom components - Support for Classic and Lightning UIs - Extended governor limits for applications **59 of 65.** Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name. What is the best solution to assign the case to the appropriate support representative? - **Use a trigger on the Case object.** - Use a formula field on the Case object. - Use a validation rule on the Case object. - Use an Assignment Flow element. **60 of 65.** What are three ways for a developer to execute tests in an org? - **Bulk API** - **Salesforce DX** - **Tooling API** - Setup Menu - Metadata API **61 of 65.** When importing and exporting data into Salesforce, which two statements are true? - **Bulk API can be used to import large data volumes in development environments without bypassing the storage limits.** - **Developer and Developer Pro sandboxes have different storage limits.** - Bulk API can be used to bypass the storage limits when importing large data volumes in development environments. - Data import wizard is an application that is installed on your computer. **62 of 65.** A developer must implement a `CheckPaymentProcessor` class that provides check processing payment capabilities that adhere to what is defined for payments in the `PaymentProcessor` interface. ```java public interface PaymentProcessor { void pay (Decimal amount); } ``` Which implementation is correct to use the `PaymentProcessor` interface class? - **`public class CheckPaymentProcessor implements PaymentProcessor {`** **`public void pay (Decimal amount);`** **}`** - `public class CheckPaymentProcessor extends PaymentProcessor {` `public void pay (Decimal amount);` `}` - `public class CheckPaymentProcessor extends PaymentProcessor {` `public void pay (Decimal amount) {` `// functional code here` `}` - `public class CheckPaymentProcessor implements PaymentProcessor {` `public void pay (Decimal amount) {` `// functional code here` `}` **65 of 65.** Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? - **Custom objects and fields** - **Roll-up summaries** - **Relationships** - Triggers - Flows ## Exam Results Time Taken: 70 minutes of 105 minutes total Result: Pass **Topic** | **Percentage Correct** ---|--- Developer Fundamentals | 71% Process Automation and Logic | 77% User Interface | 80% Testing, Debugging, and Deployment | 92% Congratulations! You have successfully completed the certification exam to become a Salesforce Certified Platform Developer I. Welcome to the Salesforce worldwide community of Certified Professionals! This document contains 65 multiple choice questions from the Salesforce Certified Platform Developer I exam. The correct answer for each question is marked in bold. This document can be used to help prepare for the exam.

Use Quizgecko on...
Browser
Browser