Platform Developer I Quiz 9 Created on June 25, 2023 By wakchourerohit@gmail.com Salesforce Certified Platform Developer I Practice Q&A 1 / 60 A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or update. The field update in the workflow rule is configured to not re-evaluate workflow rules. What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account? 3 4 1 2 2 / 60 Universal Container(UC) wants to lower its shipping cost while making the shipping process moreefficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accountsto share a default pickup address. The Developer is tasked to create the supporting object andrelationship for this business requirement and uses the Setup Menu to create a custom object called“Global Address”. Which field should the developer ad to create the most efficient model that supportsthe business need? Add a Lookup field on the Account object to the Global Address object. Add a Master-Detail field on the Account object to the Global Address object Add a Lookup field on the Global Address object to the Account object Add a Master-Detail field on the Global Address object to the Account object. 3 / 60 Which three statements are true regarding custom exceptions in Apex? (Choose three.) A custom exception class name must end with “Exception”. A custom exception class can extend other classes besides the Exception class. A custom exception class must extend the system Exception class. A custom exception class cannot contain member variables or methods. A custom exception class can implement one or many interfaces. 4 / 60 Universal Containers decides to use exclusively declarative development to build out a newSalesforce application. Which three options should be used to build out the database layerfor the application?Choose 3 answers Roll-Up Summaries Custom Objects and Fields Process Builder Relationships Triggers 5 / 60 A developer uses a loop to check each Contact in a list. When a Contact with the Title of“Boss” is found, the Apex method should jump to the first line of code outside of the forloop.Which Apex solution will let the developer implement this requirement? Next Continue Exit break; 6 / 60 An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available forLighting Web components to use. What is the correct definition of a Lighting Web component propertythat uses the getAccounts method? @wire(getAccounts, ‘$searchTerm’) accountList; @AuraEnabled(getAccounts, {searchTerm: ‘$searchTerm’}) accountList; @AuraEnabled(getAccounts, ‘$searchTerm’) accountList; @wire(getAccounts, {searchTerm: ‘$searchTerm’}) accountList; 7 / 60 What are three considerations when using the @InvocableMethod annotation in Apex?Choose 3 answers A method using the @InvocableMethod annotation must be declared as static A method using the @InvocableMethod annotation can be declared as Public or Global. A method using the @InvocableMethod annotation can have multiple input parameters. A method using the @InvocableMethod annotation must define a return value. Only one method using the @InvocableMethod annotqation can be defined per Apex class. 8 / 60 Universal Containers wants to back up all of the data and attachments in its Salesforce org once month.Which approach should a developer use to meet this requirement? Use the Data Loader command line. Define a Data Export scheduled job. Create a Schedulable Apex class. Schedule a report. 9 / 60 While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create astandard PriceBook since one already exists in the org.How should the Developer overcome this problem? Use Test.getStandardPricebookId() to get the standard PriceBook ID. Use @TestVisible to allow the test method to see the standard PriceBook. Use @IsTest(SeeAllData=true) and delete the existing standard PriceBook. Use Test.loadData() and a Static Resource to load a standard Pricebook. 10 / 60 Given the following Anonymous Block:Which one do you like?What should a developer consider for an environment that has over 10,000 Case records? The try/catch block will handle exceptions thrown by governor limits. The try/catch block will handle any DML exceptions thrown. The transaction will fail due to exceeding the governor limit. The transaction will succeed and changes will be committed. 11 / 60 A developer must modify the following code snippet to prevent the number of SOQL queries issued fromexceeding the platform governor limit. public class without sharing OpportunityService( public staticList<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem>oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId : opportunityIds){oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; }return oppLineItems; } }The above method might be called during a trigger execution via a Lightning component. Whichtechnique should be implemented to avoid reaching the governor limit? Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids. Use the System.Limits.getQueries() method to ensure the number of queries is less than 100. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds. Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100. 12 / 60 Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the standard Account object. Based on some internal discussion, the UCadministrator tried to change the Master-Detail relationship to a Lookup relationship but was not able todo so. What is a possible reason that this change was not permitted? The Vendor object must use a Master-Detail field for reporting. The Account object is included on a workflow on the Vendor object. The Account records contain Vendor roll-up summary fields. The Vendor records have existing values in the Account object. 13 / 60 Assuming that ‘name; is a String obtained by an <apex:inputText> tag on a Visualforce page.Which two SOQL queries performed are safe from SOQL injections?Choose 2 answers String query = ‘SELECT Id FROM Account WHERE Name LIKE ”%’ + name + ‘%”; List results = Database.query(query); String query = ‘SELECT Id FROM Account WHERE Name LIKE ”%’ + name.noQuotes() + ‘%”; List results = Database.query(query); String query = ‘%’ + name + ‘%’; List results = [SELECT Id FROM Account WHERE Name LIKE :query]; String query = ‘SELECT Id FROM Account WHERE Name LIKE ”%’ + String.escapeSingleQuotes(name) + ‘%”; List results = Database.query(query); 14 / 60 Which three process automations can immediately send an email notification to the owner of anOpportunity when its Amount is changed to be greater than $10,000?Choose 3 answers Process Builder Approval Process Flow Builder Workflow Rule Escalation Rule 15 / 60 Which code displays the content of Visualforce page as PDF? 16 / 60 Which three steps allow a custom SVG to be included in a Lightning web component?Choose 3 answers Import the SVG as a content asset file. Reference the import in the HTML template. Reference the getter in the HTML template. Import the static resource and provide a better for it in JavaScript. Upload the SVG as a static resource. 17 / 60 Universal Containers stores Orders and Line Items in Salesforce. For security reason, financialrepresentatives are allowed to see information on the Order such as order amount, but they are notallowed to see the Line items on the Order. Which type of relationship should be used? Direct Lookup Master Detail Indirect lookup Lookup 18 / 60 Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforcein the event that an unhandled exception occurs. Instead, UC wants an external system be notified of theerror. What is the appropriate publish/subscribe logic to meet these requirements? Have the external system subscribe to the BatchApexError event, no publishing is necessary. Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system. Publish the error event using the addError() method and have the external system subscribe to the event using CometD. Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD. 19 / 60 A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in acustom class, contactInfo. Which is the correct definition of the Apex method that gets additionalinformation? @InvocableMethod(label=’Additional Info’) public List getInfo(List contactIds) { /*implementation*/ } @InvocableMethod(label=’additional Info’) public static ContactInfo getInfo(Id contactId) { /*implementation*/ } @InvocableMethod(Label=’additional Info’) public ContactInfo(Id contactId) { /*implementation*/ } @invocableMethod(label)=’Additional Info’) public static List getInfo(List contactIds) { /*Implementation*/ } 20 / 60 Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-timenotification is not required? Asynchronous Data Capture Events Developer Log Calendar Events Event Monitoring Log 21 / 60 A developer has an integer variable called maxAttempts. The developer meeds to ensure that oncemaxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being ableto share the variable’s state between trigger executions. How should the developer declaremaxAttempts to meet these requirements? Declare maxattempts as a member variable on the trigger definition. Declare max attempts as a private static variable on a helper class Declare maxattempts as a constant using the static and final keywords Declare maxattempts as a variable on a helper class 22 / 60 Given the following trigger implementation:trigger leadTrigger on Lead (before update){final ID BUSINESS_RECORDTYPEID = ‘012500000009Qad’;for(Lead thisLead : Trigger.new){if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;}}}The developer receives deployment errors every time a deployment is attempted from Sandbox toProduction.What should the developer do to ensure a successful deployment? Ensure the deployment is validated by a System Admin user on Production. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment. Ensure BUSINESS_RECORDTYPEID is retrieved using Schema.Describe calls. Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components. 23 / 60 A developer wants to retrieve the Contacts and Users with the email address ‘dev@uc.com’.Which SOSL statement should the developer use? FIND {dev@uc.com} IN Email Fields RETURNING Contact (Email), User (Email) FIND {Email = ‘dev@uc.com’} RETURNING Contact (Email), User (Email) FIND Email IN Contact, User FOR {dev2uc.com} FIND {Email = ‘dev@uc.com’} IN Contact, User 24 / 60 What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example? Querying Accounts. Query Exception. Querying Accounts. Query Exception. Done Querying Accounts. Custom Exception Querying Accounts. Custom Exception Done. 25 / 60 What are three ways for a developer to execute tests in an org?Choose 3. Bulk API Setup Menu Salesforce DX Tooling API Metadata API. 26 / 60 Which code in a Visualforce page and/or controller might present a security vulnerability? 27 / 60 How should a custom user interface be provided when a user edits an Account in Lightning Experience? Override the Account’s Edit button with Lightning Flow Override the Account’s Edit button with Lightning Action Override the Account’s Edit button with Lightning page. Override the Account’s Edit button with Lightning component. 28 / 60 Which three data types can a SOQL query return?Choose 3 answers Long Integer List sObject 29 / 60 Universal Containers stores the availability date on each Line Item of an Order and Orders are onlyshipped when all of the Line Items are available. Which method should be used to calculate theestimated ship date for an Order? Use a CEILING formula on each of the Latest availability date fields. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order. Use a LATEST formula on each of the latest availability date fields. Use a Max Roll-Up Summary field on the Latest availability date fields. 30 / 60 Which statement generates a list of Leads and Contacts that have a field with the phrase ‘ACME’? Map searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); List searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); List<List > searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); List<List > searchList = (SELECT Name, ID FROM Contact, Lead WHERE Name like ‘%ACME%’); 31 / 60 A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in acustom class, contactInfo. Which is the correct definition of the Apex method that gets additionalinformation? @InvocableMethod(label=’Additional Info’) public List getInfo(List contactIds) { /*implementation*/ } @InvocableMethod(label=’additional Info’) public static ContactInfo getInfo(Id contactId) { /*implementation*/ } @invocableMethod(label)=’Additional Info’) public static List getInfo(List contactIds) { /*Implementation*/ } @InvocableMethod(Label=’additional Info’) public ContactInfo(Id contactId) { /*implementation*/ } 32 / 60 The values ‘High’, ‘Medium’, and ‘Low’ are Identified as common values for multiple picklist acrossdifferent object. What is an approach a developer can take to streamline maintenance of the picklist andtheir values, while also restricting the values to the ones mentioned above? Create the Picklist on each object and use a Global Picklist Value Set containing the Values. Create the Picklist on each object as a required field and select "Display values alphabeticaly, not in the order entered". Create the Picklist on each and add a validation rule to ensure data integrity. Create the Picklist on each object and select "Restrict picklist to the values defined in the value set". 33 / 60 A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawableinterfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is thecorrect implementation? Public class DrawList implements Sortable, Implements Drawable { public void sort() { /*implementation*/} public void draw() { /*implementation*/} ] Public class DrawList extends Sortable, Drawable { public void sort() { /*implementation*/} public void draw() { /*implementation*/} } Public class DrawList implements Sortable, Drawable { public void sort() { /*implementation*/} public void draw() { /*implementation*/} } Public class DrawList extends Sortable, extends Sortable, extends Drawable { public void sort() { /*implementation*/ } public void draw() { /* implementation */} 34 / 60 Which process automation should be used to send an outbound message without using Apex code? Workflow Rule Process Builder Flow Builder Approval Process 35 / 60 Which two events need to happen when deploying to a production org?Choose 2 answers All triggers must have at least 1% test coverage. All triggers must have at least 75% test coverage. All test and triggers must have at least 75% test coverage combined All Apex code must have at least 75% test coverage. 36 / 60 A developer needs to confirm that an Account trigger is working correctly without changing theorganization’s data. What would the developer do to test the Account trigger? Use the Open Execute Anonymous feature on the Developer Console to run an ‘insert Account’ DML statement. Use Deply from the Force.com IDE to deploy an ‘insert Account’ Apex class. Use the Test menu on the developer Console to run all test classes for the account trigger Use the New button on the Salesforce Accounts Tab to create a new Account record. 37 / 60 A developer needs to confirm that a Contact trigger works correctly without changing the organization’s data.What should the developer do to test the Contact trigger? Use the Open execute Anonymous feature on the Developer Console to run an ‘insert Contact’ DML statement Use the New button on the Salesforce Contacts Tab to create a new Contact record. Use Deploy from the VSCode IDE to display an ‘insert Contact’ Apex class. Use the Test menu on the Developer Console to run all test classes for the Contact trigger 38 / 60 A developer must create a ShippingCalculator class that cannot be instantiated and must include aworking default implementation of a calculate method, that sub-classes can override. What is thecorrect implementation of the ShippingCalculator class? Public abstract class ShippingCalculator { public abstract calculate() { /*implementation*/ } } Public abstract class ShippingCalculator { public void calculate() { /*implementation*/ } } Public abstract class ShippingCalculator { public virtual void calculate() { /*implementation*/ } } Public abstract class ShippingCalculator { public override calculate() { /*implementation*/ } } 39 / 60 Given the following block code: try{ List <Accounts> retrievedRecords = [SELECT Id FROM AccountWHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do toensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query? Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty. Replace the retrievedRecords variable declaration from ftount to a single Account. Check the state of the retrieveRecords variable and throw a custom exception if the variable is empty. 40 / 60 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 theirdevelopment? Scratch orgs Developer orgs Full Copy sandboxes Developer sandboxes 41 / 60 Which salesforce org has a complete duplicate copy of the production org including dataand configuration? Full Sandbox Partial Copy Sandbox Developer Pro Sandbox Production 42 / 60 A developer has the following requirements:Calculate the total amount on an Order.Calculate the line amount for each Line Item based on quantity selected and price.Move Line Items to a different Order if a Line Item is not stock.Which relationship implementation supports these requirements? Line Item has a Lookup field to Order and there can be many Line Items per Order Line Items has a Master-Detail field to Order and the Master can be re-parented. Order has a Lookup field to Line Item and there can be many Line Items per Order. Order has a Master-Detail field to Line Item and there can be many Line Items per Order. 43 / 60 A developer is tasked to perform a security review of the ContactSearch Apex class that exists in thesystem. Whithin the class, the developer identifies the following method as a security threat:List<Contact> performSearch(String lastName){ return Database.query(‘Select Id, FirstName, LastNameFROM Contact WHERE LastName Like %’+lastName+’%); }What are two ways the developer can update the method to prevent a SOQL injection attack?Choose 2 answers Use variable binding and replace the dynamic query with a static SOQL. Use the @Readonly annotation and the with sharing keyword on the class. Use a regular expression on the parameter to remove special characters. Use the escapeSingleQuote method to sanitize the parameter before its use. 44 / 60 A Next Best Action strategy uses an Enchance Element that invokes an Apex method to determine adiscount level for a Contact, based on a number of factors. What is the correct definition of the Apexmethod? @InvocableMethod global static List<List> getLevel(List input) { /*implementation*/ } @InvocableMethod global List<List> getLevel(List input) { /*implementation*/ } @InvocableMethod global Recommendation getLevel (ContactWrapper input) { /*implementation*/ } @InvocableMethod global static ListRecommendation getLevel(List input) { /*implementation*/ } 45 / 60 A developer needs to prevent the creation of request records when certain conditions exist in thesystem. A RequestLogic class exists to checks the conditions. What is the correct implementation? Trigger RequestTrigger on Request (after insert) { if (RequestLogic.isValid{Request}) Request.addError {‘Your request cannot be created at this time.’}; } Trigger RequestTrigger on Request (before insert) { RequestLogic.validateRecords {trigger.new}; } Trigger RequestTrigger on Request (after insert) { RequestLogic.validateRecords {trigger.new}; } Trigger RequestTrigger on Request (before insert) { if (RequestLogic.isvalid{Request}) Request.addError {‘Your request cannot be created at this time.’}; } 46 / 60 A developer is asked to create a Visualforce page that displays some Account fields as wellas fields configured on the page layout for related Contacts.How should the developer implement this request? Add a method to the standard controller. Use the tag. Create a controller extension. Use the tag. 47 / 60 Which aspect of Apex programming is limited due to multitenancy? The number of active Apex classes The number of methods in an Apex Class The number of records returned from database queries The number of records processed in a loop 48 / 60 What does the Lightning Component framework provide to developers? Extended governor limits for applications Support for Classic and Lightning UIS. Prebuilt component that can be reused. Templates to create custom components. 49 / 60 A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How shouldthe developer prevent a cross site scripting vulnerability? ApexPages.currentPage() .getParameters() .get(‘url_param’) .escapeHtml4() ApexPages.currentPage() .getParameters() .get(‘url_param’) String.escapeSingleQuotes(ApexPages.currentPage() .getParameters(). get(‘url_param’)) String.ValueOf(ApexPages.currentPage() .getParameters() .get(‘url_param’)) 50 / 60 Universal Containers has an order system that uses an Order Number to identify an order for customersand service agents. Order will be imported into Salesforce. Lookup Direct Lookup Number with External ID Indirect Lookup 51 / 60 A developer created a Visualforce page and custom controller to display the account type field as shownbelow. Custom controller code: public class customCtrlr{ private Account theAccount; public StringactType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id =:apexPages.currentPage().getParameters().get(‘id’)]; actType = theAccount.Type; } } Visualforce pagesnippet: The Account Type is {!actType} The value of the account type field is not being displayedcorrectly on the page. Assuming the custom controller is property referenced on the Visualforce page,what should the developer do to correct the problem? Add a getter method for the actType attribute. Change theAccount attribute to public. Add with sharing to the custom controller. Convert theAccount.Type to a String. 52 / 60 Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-timenotification is not required? Asynchronous Data Capture Events Event Monitoring Log Calendar Events Developer Log 53 / 60 A developer must implement a CheckPaymentProcessor class that provides check processing paymentcapabilities that adhere to what defined for payments in the PaymentProcessor interface. publicinterface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to usethe PaymentProcessor interface class? Public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount); } 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); } 54 / 60 A recursive transaction is limited by a DML statement creating records for these two objects:1. Accounts2. ContactsThe Account trigger hits a stack depth of 16.Which statement is true regarding the outcome of the transaction? The transaction succeeds as long as the Contact trigger stack depth is less than 16. The transaction fails and all the changes are rolled back. The transaction fails only if the Contact trigger stack depth is greater or equal to 16. The transaction succeeds and all the changes are committed to the database. 55 / 60 Where are two locations a developer can look to find information about the status of asynchronous orfuture calls?Choose 2 answers Apex Jobs Paused Flow Interviews component Apex Flex Queue Time-Based Workflow Monitor 56 / 60 Which exception type cannot be caught ? NoAccessException LimitException A custom Exception CalloutException 57 / 60 A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises95% coverage of new Apex helper class. Change Set deployment to production fails with the testcoverage 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? Increase the test class coverage on the helper class Remove the falling test methods from the test class. Run the tests using the ‘Run All Tests’ method. Create a test class and methods to cover the Apex trigger 58 / 60 A developer is implementing an Apex class for a financial system. Within the class, thevariables ‘creditAmount’ and ‘debtAmount’ should not be able to change once a value isassigned. In which two ways can the developer declare the variables to ensure their valuecan only be assigned one time?Choose 2 answers Use the final keyword and assign its value in the class constructor. Use the static keyword and assign its value in the class constructor. Use the static keyword and assign its value in a static initializer. Use the final keyword and assign its value when declaring the variable. 59 / 60 Which two are phases in the Salesforce Application Event propagation framework?Choose 2 answers Capture Bubble Default 60 / 60 An org has an existing Visual Flow that creates an Opportunity with an Update records element. Adeveloper must update the Visual Flow also created a Contact and store the created Contact’s ID on theOpportunity. Add a new Create records element. Add a new Quick Action (of type create) element. Add a new Get Records element. Add a new Update records element Your score is The average score is 77% LinkedIn Facebook Twitter VKontakte 0% Restart quiz