🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Document Details

DesirousJadeite2023

Uploaded by DesirousJadeite2023

Salesforce

Tags

Salesforce certification programming developer exam

Full Transcript

Get Success in Passing Your Certification Exam at first attempt! Copyright © CertGod.com, All Rights Reserved. All our exam practice questions and answers are only for our product buyers to get prepared for their coming certification examinations. Any unauthorized sharing is forb...

Get Success in Passing Your Certification Exam at first attempt! Copyright © CertGod.com, All Rights Reserved. All our exam practice questions and answers are only for our product buyers to get prepared for their coming certification examinations. Any unauthorized sharing is forbidden. It may cause the suspending of ones account, membership and product update if there is a violation of this rule. Join Our Telegram for Exclusive Services! Dear customers, join our Telegram for personalized pre-sales inquiries or post-sales support. Scan the QR code or click here to experience our dedicated services! Join us, and you'll enjoy: Instant Responses: Our customer service team is always on standby, ready to answer any questions you may have. Professional Support: No matter what product issues you encounter, our experts will provide professional solutions. Latest Updates: Be the first to get updates on our products and exclusive offers. Scan the QR code and join us to stay on track. Join our Telegram family now! Let us help you easily solve all your problems and enjoy a worry-free shopping experience. https://t.me/certvip Vendor: Salesforce Exam Code: PDI Exam Name: Salesforce Certification Preparation for Platform Developer I Q&As: 719 (There are 6 parts in the dump, 719 questions in total.) Exam A QUESTION 1 What are two characteristics of partial copy sandboxes versus full sandboxes? Choose 2 answers A. Includes a subset of metadata B. Requires a sandbox template C. Supports more frequent refreshes D. Provides more data record storage Correct Answer: CD Explanation Explanation/Reference: QUESTION 2 Which two automation tools include a graphical designer? Choose 2 answers A. Approvals B. Flow builder C. Process builder D. Workflows Correct Answer: BC Explanation Explanation/Reference: QUESTION 3 A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this? A. Controller.js B. Superrender.js C. Rendered.js D. Helper.js Correct Answer: D Explanation Explanation/Reference: QUESTION 4 Which standard field is required when creating a new contact record? A. LastName B. Name C. AccountId D. FirstName Correct Answer: A Explanation QUESTION 5 The sales team at universal container would like to see a visual indicator appear on both account and opportunity page layout to alert salespeople when an account is late making payments or has entered the collections process. What can a developer implement to achieve this requirement without having to write custom code? A. Workflow rule B. Formula field C. Roll-up summary field D. Quick action Correct Answer: B Explanation Explanation/Reference: QUESTION 6 To which primitive data type is a text area (rich) field automatically assigned? A. Text B. Blob C. Object D. String Correct Answer: D Explanation QUESTION 7 An apex trigger fails because it exceeds governor limits. Which two techniques should a developer use to resolve the problem? Choose 2 answers A. Use the database class to handle DML operations B. Use maps to reference related records C. Use SOQL aggregate queries to retrieve child records D. Use lists for all DML operations Correct Answer: BD Explanation QUESTION 8 Which statement is true about developing in a multi-tenant environment? A. Governor limits prevent apex from impactiong the performance of multiple tenants on the same instance B. Apex sharing controls access to records fomr multiple tenants on the same instance C. Global apex classes can be referenced from multiple tenants on the same instance D. Org-level data security controls which users can see data from multiple tenants on the same instance Correct Answer: A Explanation QUESTION 9 A developer needs to create a custom visualforce button for the opportunity object page layout that will cause a web service to be called and redirect the user to a new page when clicked. Which three attributes need to be defined in the tag of the visualforce page to enable this functionality? A. Standardcontroller B. Extensions C. AcTion D. Readonly E. Renderas Correct Answer: ABC Explanation Explanation/Reference: QUESTION 10 The Account object has a custom Percent field, Rating, defined with a length of 2 with 0 decimal places. An Account record has the value of 50% in its Rating field and is processed in the Apex code below after being retrieved from the database with SOQL. What is the value of acctScore after this code executes? A. 5 B. 50 C. 500 D. 5000 Correct Answer: D Explanation Explanation/Reference: QUESTION 11 A developer can use the debug log to see which three types of information? Choose 3 answers A. Resource usage and limits B. Database changes C. User login events D. HTTP callout to external systems E. Actions triggered by time-based workflow Correct Answer: BDE Explanation QUESTION 12 A developer is notified that a text field is being automatically populated with invalid values.however, this should be prevented by a custom validation rule that is in placewhat could be causing this? A. The field is being populated by a workflow field update B. A DML exception is occuring during the save order of execution C. The field is being populated by a before trigger D. The user belongs to a permission set that suppresses the validation rule Correct Answer: A Explanation QUESTION 13 A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create? A. After insert B. After update C. Before update D. Before insert Correct Answer: CD Explanation QUESTION 14 What si the debug output of the following apex code? Decimal thevalue; system.debug(thevalue); A. Undefined B. 0 C. Null D. 0.0 Correct Answer: C Explanation QUESTION 15 From which 2 locations can a developer determine the overall code coverage for a sandbox? A. The test suite run panel of the developer console B. The apex classes setup page C. The apex test execution page D. The tests tab of the developer console Correct Answer: BD Explanation QUESTION 16 Given the code below, what can be done so that recordcount can be accessed by a test class, but not by a non-test class? Public class mycontroller{ private integer recordcount; } A. Add a seealldata annotation to the test class B. Add the testvisible annotation to recordcount C. Change recordcount from private to public D. Add the testvisible annotation to the mycontroller class Correct Answer: B Explanation QUESTION 17 A developer is asked to create a custom visualforce page that will be used as a dashboard component. Which three are valid controller options for this page? Choose 3 answers A. Use a custom controller B. Use a custom controller with extensions C. Use a standard controller with extensions D. Do not specify a controller E. Use a standard controller Correct Answer: ACE Explanation QUESTION 18 What is the data type returned by the following SOSL search? [FIND ‘Acme*’ IN NAME FIELDS RETURNING Account, Opportunity]; A. List75%) code coverage. D. The deployment passes because both classes and the trigger were included in the deployment. Correct Answer: A Explanation Explanation/Reference: QUESTION 68 A Licensed_Professional_c custom object exists in the system with two Master-Detail fields for the following objects: Certification_c and Contact. Users with the “Certification Representative” role can access the Certification records they own and view the related Licensed Professionals records, however users with the “Sales Representative” role report they cannot view any Licensed Professional records even though they own the associated Contact record. What are two likely causes of users in the “Sales Representative” role not being able to access the Licensed Professional records? (Choose two.) A. The organization's sharing rules for Licensed_Professional_c have not finished their recalculation process. B. The organization recently modified the Sales representative role to restrict Read/Write access to Licensed_Professional_c C. The organization has a private sharing model for Certification_c, and Contact is the primary relationship in the Licensed_Professional_c object D. The organization has a private sharing model for Certification_c, and Certification_c is the primary relationship in the Licensed_Professional_c object. Correct Answer: AC Explanation Explanation/Reference: QUESTION 69 Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error. What is the appropriate publish/subscribe logic to meet these requirements? A. Publish the error event using the addError() method and have the external system subscribe to the event using CometD. B. Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD. C. Have the external system subscribe to the BatchApexError event, no publishing is necessary. D. Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system. Correct Answer: B Explanation Explanation/Reference: QUESTION 70 A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console? A. The test method has a syntax error in the code. B. The test method relies on existing data in the sandbox. C. The test method is calling an @future method. D. The test method does not use System.runAs to execute as a specific user. Correct Answer: B Explanation Explanation/Reference: QUESTION 71 A developer considers the following snippet of code: Based on this code, what is the value of x? A. 2 B. 1 C. 3 D. 4 Correct Answer: D Explanation Explanation/Reference: QUESTION 72 Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records. which Visualforce feature supports this requirement? A. tag B. Custom controller C. RecordSetVar page attribute D. Controller extension Correct Answer: C Explanation QUESTION 73 A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability? A. ApexPages.currentPage().getParameters().get('url_param') B. ApexPages.currentPage().getParameters().get('url_param').escapeHtml4() C. String.ValueOf(ApexPages.currentPage().getParameters().get('url_param')) D. String.escapeSingleQuotes(ApexPages.currentPage().getParameters(). get('url_param')) Correct Answer: B Explanation QUESTION 74 A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles. Which tool should they use to deploy to the sandbox? A. Change Sets B. VSCode C. Ant Migration Tool D. Developer Console Correct Answer: C Explanation QUESTION 75 If apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which statement are true regarding governor limits? Choose 2 answers A. The Apex governor limits might be higher due to the asynchronous nature of the transaction.(Missed) B. The apex governor limits are reset for each iteration of the execute() mrthod. C. The Apex governor limits are relaxed while calling the costructor of the Apex class. D. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction, Correct Answer: AB Explanation Explanation/Reference: QUESTION 76 Application Events follow the traditional publish-subscribe model. Which method is used to fire an event? A. Fire() B. Emit() C. RegisterEvent() D. FireEvent() Correct Answer: A Explanation QUESTION 77 When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs? A. Production B. Dev Hub C. Environment Hub D. Sandbox Correct Answer: B Explanation Explanation/Reference: When using SalesforceDX, a developer needs to enable Dev Hub in order to create and manage scratch orgs. A Dev Hub is a special type of org used by developers to store source code and other development- related artifacts. It is also used to create and manage scratch orgs, which are temporary orgs used for development and testing. Reference: https://developer.salesforce.com/docs/atlas.en- us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm QUESTION 78 A developer wants to retrieve the Contacts and Users with the email addres '[email protected]'. Which SOSL statement should the developer use? A. FIND {[email protected]} IN Email Fields RETURNING Contact (Email), User (Email) B. FIND {Email = '[email protected]'} IN Contact, User C. FIND {Email = '[email protected]'} RETURNING Contact (Email), User (Email) D. FIND Email IN Contact, User FOR {dev2uc.com} Correct Answer: A Explanation Explanation/Reference: QUESTION 79 Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order records will be imported into Salesforce. How should the Order Number field be defined in Salesforce? A. Lookup B. Direct Lookup C. Number with External ID D. Indirect Lookup Correct Answer: C Explanation Explanation/Reference: QUESTION 80 What are three considerations when using the @InvocableMethod annotation in Apex? (Choose three.) A. A method using the @InvocableMethod annotation must be declared as static. B. A method using the @InvocableMethod annotation can be declared as Public or Global. C. A method using the @InvocableMethod annotation can have multiple input parameters. D. A method using the @InvocableMethod annotation must define a return value. E. Only one method using the @InvocableMethod annotation can be defined per Apex class. Correct Answer: ABE Explanation Explanation/Reference: QUESTION 81 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? A. Use the Data Loader command line. B. Create a Schedulable Apex class. C. Schedule a report. D. Define a Data Export scheduled job. Correct Answer: D Explanation Explanation/Reference: Scheduling a Data Export job is the best way to back up all the data and attachments in a Salesforce org once a month. The Data Export job can be scheduled to run at a certain frequency so that the data can be backed up on a regular basis. This makes it easy to restore the data in case of any emergency. QUESTION 82 Universal Containers stores Orders and Line Items in Salesforce. For security reason, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line items on the Order. Which type of relationship should be used? A. Lookup B. Direct Lookup C. Indirect lookup D. Master Detail Correct Answer: D Explanation QUESTION 83 Which code in a Visualforce page and/or controller might present a security vulnerability? A. B. C. D. Correct Answer: B Explanation QUESTION 84 In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers A. Self-contained and reusable units of an application B. Rich component ecosystem C. Automatic code generation D. Server-side run-time debugging Correct Answer: AB Explanation Explanation/Reference: QUESTION 85 What is the maximum number of SOQL queries used by the following code? A. 5 B. 6 C. 1 D. 2 Correct Answer: B Explanation Explanation/Reference: QUESTION 86 A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit? A. Use the System.Limits.getQueries() method to ensure the number of queries is less than 100. B. Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100. C. Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids. D. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds. Correct Answer: D Explanation Explanation/Reference: QUESTION 87 Which process automation should be used to send an outbound message without using Apex code? A. Workflow Rule B. Process Builder C. Approval Process D. Flow Builder Correct Answer: A Explanation QUESTION 88 A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test? A. Use Anonymous Apex to create the required data. B. Use SOQL to query the org for the required data. C. Use Test.loadData() and reference a CSV file in a static resource. D. Use Test.loadData() and reference a JSON file in Documents. Correct Answer: C Explanation Explanation/Reference: QUESTION 89 Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are avaible. Which method should be used to calculate the estimated ship date for an Order? A. Use a CEILING formula on each of the Latest availability date fields. B. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order. C. Use a LATEST formula on each of the latest availability date fields. D. Use a Max Roll-Up Summary field on the Latest availability date fields. Correct Answer: D Explanation QUESTION 90 A Next Best Action strategy uses an Enchance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors. What is the correct definition of the Apex method? A. @InvocableMethod global static ListRecommendation getLevel(List input) { } B. @InvocableMethod global static List getLevel(List input) { } C. @InvocableMethod global List getLevel(List input) { } D. @InvocableMethod global Recommendation getLevel (ContactWrapper input) { } Correct Answer: B Explanation QUESTION 91 The values 'High', 'Medium', and 'Low' are Identified as common values for multiple picklist across different object. What is an approach a developer can take to streamline maintenance of the picklist and their values, while also restricting the values to the ones mentioned above? A. Create the Picklist on each object and use a Global Picklist Value Set containing the Values. B. Create the Picklist on each object as a required field and select "Display values alphabeticaly, not in the order entered". C. Create the Picklist on each object and select "Restrict picklist to the values defined in the value set". D. Create the Picklist on each and add a validation rule to ensure data integrity. Correct Answer: A Explanation Explanation/Reference: QUESTION 92 A developer has the following requirements: 1. Calculate the total amount on an Order. 2. Calculate the line amount for each Line Item based on quantity selected and price. 3. Move Line Items to a different Order if a Line Item is not stock. Which relationship implementation supports these requirements? A. Line Items has a Master-Detail field to Order and the Master can be re-parented. B. Line Item has a Lookup field to Order and there can be many Line Items per Order C. Order has a Lookup field to Line Item and there can be many Line Items per Order. D. Order has a Master-Detail field to Line Item and there can be many Line Items per Order. Correct Answer: A Explanation Explanation/Reference: QUESTION 93 What are two ways a developer can get the status of an enquered job for a class that queueable interface? Choose 2 answers A. View the apex status Page B. View the apex flex Queue C. View the apex Jobs page D. Query the AsyncApexJobe object Correct Answer: AC Explanation Explanation/Reference: QUESTION 94 What should be used to create scratch orgs? A. Sandbox refresh B. Salesforce CLI C. Developer Console D. Workbench Correct Answer: B Explanation QUESTION 95 A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in a custom class, contactInfo. Which is the correct definition of the Apex method that gets additional information? A. @InvocableMethod(label='Additional Info') public List getInfo(List contactIds) { } B. @InvocableMethod(label='additional Info') public static ContactInfo getInfo(Id contactId) { } C. @invocableMethod(label)='Additional Info') public static List getInfo(List contactIds) { } D. @InvocableMethod(Label='additional Info') public ContactInfo(Id contactId) { } Correct Answer: C Explanation Explanation/Reference: QUESTION 96 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? A. Use the New button on the Salesforce Contacts Tab to create a new Contact record. B. Use the Open execute Anonymous feature on the Developer Console to run an 'insert Contact' DML statement C. Use Deploy from the VSCode IDE to display an 'insert Contact' Apex class. D. Use the Test menu on the Developer Console to run all test classes for the Contact trigger Correct Answer: D Explanation Explanation/Reference: QUESTION 97 Which three process automations can immediately send an email notification to the owner of an Opportunity when its Amount is changed to be greater than $10,000? Choose 3 answers A. Workflow Rule B. Flow Builder C. Approval Process D. Escalation Rule E. Process Builder Correct Answer: ACE Explanation Explanation/Reference: QUESTION 98 A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors. What is the correct definition of the Apex method? A. @InvocableMethod global static ListRecommendation getLevel(List input) { } B. @InvocableMethod global static List getLevel (List input) { } C. @InvocableMethod global List getlevel(List input) { } D. @InvocableMethod global Recommendation getlevel(ContactWrapper input) { } Correct Answer: B Explanation Explanation/Reference: QUESTION 99 A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly referenced on the Visualforce page, what should the developer do to correct the problem? A. Add a getter method for the actType attribute. B. Change theAccount attribute to public. C. Convert theAccount.Type to a String. D. Add with sharing to the custom controller. Correct Answer: A Explanation Explanation/Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_custom.htm QUESTION 100 A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { / *implementation*/ } } Which is the correct implementation? A. Public class CreditcardPayment extends Payment { public override void makePayment(Decimal amount) { } } B. Public class CreditCardPayment implements Payment { public virtual void makePayment(Decimal amount) { } } C. Public class CreditCardPayment extends Payment { public virtual void makePayment(Decimal amount) { } } D. Public class CreditCardPayment implements Payment { public override void makePayment(Decimal amount) { } } Correct Answer: A Explanation Explanation/Reference: QUESTION 101 Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address". Which field should the developer add to create the most efficient model that supports the business need? A. Add a Master-Detail field on the Account object to the Global Address object B. Add a Master-Detail field on the Global Address object to the Account object. C. Add a Lookup field on the Account object to the Global Address object. D. Add a Lookup field on the Global Address object to the Account object Correct Answer: B Explanation Explanation/Reference: QUESTION 102 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 UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able todo so. What is apossible reason that this change was not permitted? A. The Account records contain Vendor roll-up summary fields. B. The Vendor object must use a Master-Detail field for reporting. C. The Vendor records have existing values in the Account object. D. The Account object is included on a workflow on the Vendor object. Correct Answer: A Explanation Explanation/Reference: QUESTION 103 A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of 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? A. Create a test class and methods to cover the Apex trigger B. Run the tests using the 'Run All Tests' method. C. Remove the falling test methods from the test class. D. Increase the test class coverage on the helper class Correct Answer: C Explanation Explanation/Reference: QUESTION 104 How should a custom user interface be provided when a user edits an Account in Lightning Experience? A. Override the Account's Edit button with Lightning Flow B. Override the Account's Edit button with Lightning Action C. Override the Account's Edit button with Lightning page. D. Override the Account's Edit button with Lightning component. Correct Answer: D Explanation QUESTION 105 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 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? A. B. C. D. Correct Answer: A Explanation Explanation/Reference: QUESTION 106 A developer is debugging the following code to determine why Accounts are not being created. Account a = new Account(Name = 'A'); Database.insert(a, false); How should the code be altered to help debug the issue? A. Add a System.debug() statement before the insert method B. Add a try/catch around the insert method C. Set the second insert method parameter to TRUE D. Collect the insert method return value a Saveresult record Correct Answer: B Explanation Explanation/Reference: QUESTION 107 What is the order of operations when a record is saved in Salesforce? A. Process flows, triggers, workflow, commit B. Workflow, process flows, triggers, commit C. Workflow, triggers, process flows, commit D. Triggers, workflow, process flows, commit Correct Answer: D Explanation QUESTION 108 Which two are best practices when it comes to component and application event handling? Choose 2 answers A. Handle low-level events in the event handler and re-fire them as higher-level events. B. Try to use application events as opposed to component events. C. Use component events to communicate actions that should be handled at the application level. D. Reuse the event logic in a component bundle, by putting the logic in the helper. Correct Answer: AD Explanation Explanation/Reference: QUESTION 109 Which aspect of Apex programming is limited due to multitenancy? A. The number of active Apex classes B. The number of methods in an Apex Class C. The number of records processed in a loop D. The number of records returned from database queries Correct Answer: D Explanation QUESTION 110 The following Apex method is part of the ContactService class that is called from a trigger: How should the developer modify the code to ensure best practices are met? A. Option A B. Option B C. Option C D. Option D Correct Answer: C Explanation Explanation/Reference: QUESTION 111 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. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class? A. public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount); B. public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount){} C. public class CheckPaymentProcessor extends PaymentProcessor { public void pay(Decimal amount){} D. public class CheckPaymentProcessor extends PaymentProcessor { public void pay(Decimal amount); Correct Answer: B Explanation Explanation/Reference: QUESTION 112 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? A. Developer sandboxes B. Scratch orgs C. Full Copy sandboxes D. Developer orgs Correct Answer: B Explanation QUESTION 113 Given the following block code: try{ List retrievedRecords = [SELECT Id FROM Account WHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query? A. Check the state of the retrieveRecords variable and throw a custom exception if the variable is empty. B. Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty C. Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty. D. Replace the retrievedRecords variable declaration from a List of Account to a single Account. Correct Answer: B Explanation QUESTION 114 A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface? A. Override the Contact's Edit button with a Lightning page Salesforce Classic and a Visualforce page in Lightning Experience. B. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning page in Lightning experience. C. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. D. Override the Contact's Edit button with a Lightning component in Salesforce Classic and a Lightning component in Lightning experience. Correct Answer: C Explanation QUESTION 115 A developer has to Identify a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database. Which two techniques should the developer implement as a best practice to esure transaction control and avoid exceeding governor limits? Choose 2 answers A. Use the Database.Savepoint method to enforce database integrity. B. Use the System.Limit class to monitor the current CPU governor limit consuption. C. Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL. D. Use Partial DML statements to ensure only valid data is committed. Correct Answer: AB Explanation Explanation/Reference: QUESTION 116 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 succesfully perform deletions? A. AccountRec.sObjectType.isDeleteable() B. Schema.sObjectType.Account.isDeletable() C. AccountRec.isdeletable() D. Account.isDelketable() Correct Answer: B Explanation QUESTION 117 Which two operations can be performed using a formula field? Choose 2 answers A. Displaying the last four digits of an encrypted Social Security number B. Triggering a Process Builder C. Displaying an Image based on the Opportunity Amount D. Calculating a score on a Lead based on the information from another field Correct Answer: CD Explanation Explanation/Reference: QUESTION 118 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 most efficient way to ensure a value is selected every time a record is saved? A. Set "Use the first value in the list as the default value" as True. B. Set a validation rule to enforce a value is selected. C. Mark the field as Required on the field definition. D. Mark the field as Required on the object's page layout. Correct Answer: C Explanation Explanation/Reference: QUESTION 119 Where are two locations a developer can look to find information about the status of asynchronous or future cals? Choose 2 answers A. Apex Flex Queue B. Apex Jobs C. Paused Flow Interviews component D. Time-Based Workflow Monitor Correct Answer: AB Explanation Explanation/Reference: QUESTION 120 A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. Which is the correct implementation? A. Option A B. Option B C. Option C D. Option D Correct Answer: D Explanation Explanation/Reference: QUESTION 121 Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'? A. List searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); B. List searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); C. Map searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead); D. List> searchList = (SELECT Name, ID FROM Contact, Lead WHERE Name like '% ACME%'); Correct Answer: B Explanation QUESTION 122 Which three web technologies can be integrated into a Visualforce page? Choose 3 answares A. HTML B. Java C. PHP D. CSS E. JavaScript Correct Answer: ADE Explanation Explanation/Reference: QUESTION 123 A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable's state between trigger executions. How should the developer declare maxAttempts to meet these requirements? A. Declare maxattempts as a member variable on the trigger definition. B. Declare maxattempts as a private static variable on a helper class C. Declare maxattempts as a constant using the static and final keywords D. Declare maxattempts as a variable on a helper class Correct Answer: C Explanation QUESTION 124 Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool? A. Use the schema describe calls to determine if the logged-in user has access to the Account object. B. Use the without sharing keyword on the class declaration. C. Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user. D. Use the with sharing keyword on the class declaration. Correct Answer: D Explanation Explanation/Reference: Use the with sharing keyword on the class declaration. The with sharing keyword ensures that the Apex code respects the object-level, field-level, and record-level sharing settings for the user who is running the Apex code. This means that the code will only return records that the user has access to, according to their Sharing Settings. You can find more information about the with sharing keyword in the official Salesforce documentation (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/ apex_classes_keywords_sharing.htm). QUESTION 125 A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat: List 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? Choose 2 answers A. Use variable binding and replace the dynamic query with a static SOQL. B. Use the escapeSingleQuote method to sanitize the parameter before its use. C. Use a regular expression expression on the parameter to remove special characters. D. Use the @Readonly annotation and the with sharing keyword on the class. Correct Answer: AB Explanation Explanation/Reference: Exam B QUESTION 1 What are three ways for a developer to execute tests in an org? Choose 3. A. Bulk API B. ToolingAPI C. Metadata API D. Setup Menu E. Developer Console Correct Answer: BCD Explanation Explanation/Reference: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_testing.htm https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/ tooling_api_objects_apextestsuite.htm QUESTION 2 A developer created a helper class with a method that can be called from Visualforce pages, web services, triggers, and of even anonymous code. When the method is called from a trigger, the developer needs to execute logic that should not be executed If the method Is called from anywhere else. How can the developer determine if the code Is executed in a trigger context? A. Check if System.executionContext =='Trigger'. B. Use the executeOnTrigger annotation on the method definition. C. Check if Trigger.isExecuting ==true D. Check if Trigger.newMap !=null. Correct Answer: C Explanation QUESTION 3 Which collection type provides unique key/value pairings of data? A. Map B. List C. Array D. Set Correct Answer: A Explanation QUESTION 4 What can a developer use to determine if the core Apex code exceeds any governor limits in a test class during bulk execution? A. Limits, startTest, stopTest B. Test.getDmlStatements() C. @TestSetup. D. @TestVisible Correct Answer: A Explanation QUESTION 5 What are two features of Heroku Connect? Choose 2 answers A. Displaying data from an external data store via External Objects. B. Real Time Sync between Salesforce and Postgres C. Bidirectional syncs, allowing data to be written into Salesforce D. Near Real Time Sync between Heroku Postgres and Salesforce Correct Answer: CD Explanation QUESTION 6 A developer is asked to write negative tests as part of the unit testing for a method that calculates a person's age based on birth date. What should the negative tests include? A. Assert that future dates are rejected by the method. B. Assert that past dates are accepted by the method. C. Assert that a null value is accepted by the method. D. Throwing a custom exception in the unit test. Correct Answer: A Explanation QUESTION 7 A developer has created a Visualforce Page and Apex Controller that uses the With Sharing keyword. The page will be used of by Sales Managers and should only display Accounts owned by Sales Representatives who report to the running Sales Manager. The organization-wide sharing for Accounts is set to Private. Which additional set of stops should the developer take? A. Create one Profile, two Permission Sets, and one Role. B. Create one Profile, one Permission Set, and one Role. C. Create one Profile, one Permission Set, and two Roles. D. Create two Profiles, one Permission Set, and one Role. Correct Answer: C Explanation QUESTION 8 When would the use of Heroku Postgres be appropriate? A. To cache commonly accessed data for faster retrieval. B. To interconnect Microsoft SQL servers to Heroku Applications. C. To store and retrieve data using the Structured Query Language. D. To store user generated pictures and Word documents. Correct Answer: C Explanation QUESTION 9 How can a custom type be identified as unique when added to a Set? A. Methods in the class must be static B. The class must implement the Equals and Hashcode methods C. Methods in the class must be global D. The class must have a method with the @InvocableMethod annotation Correct Answer: B Explanation QUESTION 10 A sales manager wants to make sure that whenever an opportunity stage is changed to 'Closed Won', a new case will be of created for the support team to collect necessary information from the customer. How should a developer accomplish this? A. Create a Process Builder to create the new case. B. Set up a validation rule on the Opportunity Stage. C. Create a lookup field to the Case object on the opportunity object. D. Create a workflow rule to create the new case. Correct Answer: A Explanation QUESTION 11 What are two valid options for iterating through each Account in the collection List named AccountList? Choose 2 answers. A. For (List L : AccountList) {...} B. For (Account theAccount : AccountList){...} C. For(AccountList){...} D. For (Integer i=0; i 0) Line-05: l.Territory_c = terrList.Id; Line-06: }Line-07: } Which line of code is causing the code block to fail? A. Line-03: A SOQL query is located inside of the for loop code. B. Line-01: Trigger:new is not valid in a before insert Trigger. C. Line-02: A NullPointer exception is thrown if PostalCode is null. D. Line-05: The Lead in a before insert trigger cannot be updated. Correct Answer: A Explanation Explanation/Reference: QUESTION 32 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 Answer: A Explanation Explanation/Reference: QUESTION 33 Which requirement needs to be implemented by using standard workflow instead of Process Builder? Choose 2 answers A. Create activities at multiple intervals. B. Send an outbound message without Apex code. C. Copy an account address to its contacts. D. Submit a contract for approval. Correct Answer: BC Explanation QUESTION 34 An org has different Apex Classes that provide Account -related functionality.After a new validation rule is added to the object, many of the test methods fail.What can be done to resolve the failures and reduce the number of code changes needed for future validation rules?Choose 2 answers: A. Create a method that creates valid Account records, and call this method from within test methods. B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods. C. Create a method that performs a callout for a valid Account record, and call this method from within test methods. D. Create a method that queries for valid Account records, and call this method from within test methods. Correct Answer: AB Explanation Explanation/Reference: QUESTION 35 Which component is available to deploy using Metadata API? Choose 2 answers A. Case Layout B. Account Layout C. Case Feed Layout D. ConsoleLayout Correct Answer: AB Explanation QUESTION 36 In the code below, what type does Boolean inherit from? Boolean b= true; A. Enum B. Object C. String D. Class Correct Answer: B Explanation QUESTION 37 What is the preferred way to reference web content such as images, style sheets, JavaScript, and other libraries that is used in Visualforce pages? A. By accessing the content from Chatter Files. B. By uploading the content in the Documents tab. C. By accessing the content from a third -party CON. D. By uploading the content as a Static Resource. Correct Answer: D Explanation QUESTION 38 A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce.Which kind of relationship would a developer use to relate the Account to the Warehouse? A. One -to -Many B. Lookup C. Master -Detail D. Parent -Child Correct Answer: B Explanation QUESTION 39 A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object. What happens when a user updates a record? A. No changes are made to the data. B. Both the Apex Trigger and Workflow Rule are fired only once. C. The Workflow Rule is fired more than once. D. The Apex Trigger is fired more than once. Correct Answer: D Explanation QUESTION 40 What is true for a partial sandbox that is not true for a full sandbox? Choose 2 answers: A. More frequent refreshes. B. Only Includes necessary metadata. C. Use of change sets. D. Limited to 5 GB of data. Correct Answer: AD Explanation QUESTION 41 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 Answer: A Explanation QUESTION 42 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. A. The values in Campaignmember.Estimated_value_c are converted into the currency of the Campaign record and the sum is displayed using the currency on the Campaign record. B. The values in CampaignMember.Estimated_value_c are converted into the currency on the majority of the CampaignMember records and the sum is displayed using that currency. C. The values in CampaignMember.Estimated_value_c are summed up and the resulting Total_estimated_value_c field is displayed as a numeric field on the Campaign record. D. The values In CampaignMember.Estimated_value_c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record. Correct Answer: A Explanation Explanation/Reference: QUESTION 43 A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting, that application cannot be modified to be resubmitted to a different job posting.What can the administrator do to associate an application with each job posting in the schema for the organization? A. Create a lookup relationship on both objects to a junction object called Job Posting Applications. B. Create a master-detail relationship in the Job Postings custom object to the Applications custom object. C. Create a master-detail relationship in the Application custom object to the Job Postings custom object. D. Create a lookup relationship in the Applications custom object to the Job Postings custom object. Correct Answer: C Explanation QUESTION 44 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. Correct Answer: AC Explanation QUESTION 45 What is a capability of cross-object formula fields? Choose 3 answers A. Formula fields can reference fields from master-detail or lookup parent relationships. B. Formula fields can expose data the user does not have access to in a record. C. Formula fields can be used in three roll-up summaries per object. D. Formula fields can reference fields in a collect of records from a child relationship. E. Formula fields can reference fields from objects that are up to 10 relationships away. Correct Answer: ABE Explanation QUESTION 46 A developer created an Apex trigger using the Developer Console and now wants to debug codeHow 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. Correct Answer: D Explanation QUESTION 47 Which data structure is returned to a developer when performing a SOSL search? A. A list of lists of sObjects. B. A map of sObject types to a list of sObjects C. A map of sObject types to a list oflists of sobjects D. A list of sObjects. Correct Answer: A Explanation QUESTION 48 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. Correct Answer: CD Explanation QUESTION 49 What is a correct pattern to follow when programming in Apex on a Multi-tenant platform? A. Apex code is created in a separate environment from schema to reduce deployment errors. B. DML is performed on one record at a time to avoid possible data concurrency issues. C. Queries select the fewest fields and records possible to avoid exceeding governor limits. D. Apex classes use the ''with sharing" keyword to prevent access from other server tenants. Correct Answer: C Explanation QUESTION 50 What should a developer working in a sandbox use to exercise a new test Class before the developer deploys that test production?Choose 2 answers A. The REST API and ApexTestRun method B. The Apex Test Execution page in Salesforce Setup. C. The Test menu in the Developer Console. D. The Run Tests page in Salesforce Setup. Correct Answer: BC Explanation QUESTION 51 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 Answer: D Explanation QUESTION 52 What is the accurate statement about with sharing keyword? choose 2 answers 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 Answer: AB Explanation QUESTION 53 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 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 Answer: AB Explanation QUESTION 54 Which standard field needs to be populated when a developer inserts new Contact records programmatically? A. Accountld B. Name C. LastName D. FirstName Correct Answer: C Explanation QUESTION 55 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 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. Correct Answer: C Explanation Explanation/Reference: QUESTION 56 Developer needs to automatically populate the Reports To field in a Contact record based 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 Correct Answer: AC Explanation Explanation/Reference: QUESTION 57 To which primitive data type in Apex is a currency field atomically assigned? A. Integer B. Decimal C. Double D. Currency Correct Answer: B Explanation QUESTION 58 Which resource can be included in a Lightning Component bundle?Choose 2 answers A. Apex class B. Adobe Flash C. JavaScript D. Documentation Correct Answer: CD Explanation QUESTION 59 A custom exception "RecordNotFoundException" is defined by the following code of block.public class RecordNotFoundException extends Exception()which statement can a developer use to throw a custom exception? choose 2 answers A. Throw new RecordNotFoundException("problem occured"); B. Throw new RecordNotFoundException(); C. throw RecordNotFoundException("problem occured"); D. Throw RecordNotFoundException(); Correct Answer: AB Explanation Explanation/Reference: QUESTION 60 When creating unit tests in Apex, which statement is accurate?Choose 2 A. Unit tests with multiple methods result in all methods failing 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 Assert statements that do not Increase code coverage contribute important feedback in unit tests Correct Answer: BD Explanation QUESTION 61 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 Answer: B Explanation QUESTION 62 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? Choose 3 answers A. Public ExtendedController (ApexPages.StandardController cntrl) { } B. ApexPages.currentPage().getParameters().put('input', 'TestValue') C. Test.setCurrentPage(pageRef), D. String nextPage = controller.save().getUrl(); E. insert pageRef. Correct Answer: BCD Explanation Explanation/Reference: QUESTION 63 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 returned by Case.SObjectType getDescribe().getRecordTypelnfos() C. Use SOQL to query Case records in the org to get all the RecordType values available for Case. D. Use SOQL to query Case records in the org to get all value for the Status picklist field. Correct Answer: AB Explanation QUESTION 64 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 field 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 Application_c.Status_c into a roll -up summary field. B. By changing 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. Correct Answer: C Explanation QUESTION 65 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 Answer: A Explanation QUESTION 66 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 < 250; x++) {Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;}catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount'); How many accounts are in the org after this code is run? A. 101 B. 100 C. 102 D. 252 Correct Answer: B Explanation QUESTION 67 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? Select one of the following: 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 the 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 Answer: B Explanation QUESTION 68 What is a capability of the Force.com IDE? Choose 2 answers A. Roll back deployments. B. Run Apex tests. C. Download debug logs. D. Edit metadata components. Correct Answer: BD Explanation QUESTION 69 Which code segment can be used to control when the dowork() method is called? A. For (Trigger.isRunning t: Trigger.new) { dowork(); } B. If(Trigger.isRunning) dowork(); C. For (Trigger.isInsert t: Trigger.new) { dowork(); } D. If(Trigger.isInsert) dowork(); Correct Answer: D Explanation QUESTION 70 When would a developer use a custom controller instead of a controller extension? A. When a Visualforce page needs to replace the functionality of a standard controller B. When a Visualforce page does not reference a single primary object C. When a Visualforce page should not enforce permissions or field-level security D. When a Visualforce page needs to add new actions to a standard controller Correct Answer: BC Explanation QUESTION 71 What is a valid statement about Apex classes and interfaces? Choose 2 answers: A. The default modifier for a class is private. B. Exception classes must end with the word exception. C. A class can have multiple levels of inner classes. D. The default modifier for an interface is private. Correct Answer: BD Explanation QUESTION 72 A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List childCases = new List();for (Case parent : Trigger.new){Case child = new Case (ParentId = parent.Id, Subject = parent.Subject);childCases.add(child);}insert childCases; What happens after the code block executes? A. Multiple child cases are created for each parent case in Trigger.new. B. Child case is created for each parent case in Trigger.new. C. The trigger enters an infinite loop and eventually fails. D. The trigger fails if the Subject field on the parent is blank. Correct Answer: B Explanation QUESTION 73 When the number of record in a recordset is unknown, which control statement should a developer use to implement a 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 Answer: C Explanation QUESTION 74 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 Answer: B Explanation QUESTION 75 A developer has the following code block: public class PaymentTax {public static decimal SalesTax = 0.0875;} trigger OpportunityLineItemTrigger on OpportunityLineItem (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. OpportunityLineItemTngger.SalesTax Correct Answer: C Explanation Explanation/Reference: QUESTION 76 On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL? A. Use the constructor method for the controller. B. Use the $Action.View method in the Visualforce page. C. Create a new PageReference object with the Id. D. Use the tag in the Visualforce page. Correct Answer: A Explanation QUESTION 77 Where can debug log filter settings be set?Choose 2 answers A. The Filters link by the monitored user's name within the web UI. B. The Show More link on the debug log's record. C. On the monitored user's name. D. The Log Filters tab on a class or trigger detail page. Correct Answer: AD Explanation QUESTION 78 Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct? A. The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object. B. The Lookup Relationship cannot be marked as required on the page layout for the Custom Object. C. The Custom Object will be deleted when the referenced Standard Object is deleted. D. The Custom Object inherits security from the referenced Standard Objects Correct Answer: C Explanation QUESTION 79 On which object can an administrator create a roll-up summary field? A. Any object that is on the master side of a master-detail relationship. B. Any object that is on the parent side of a lookup relationship. C. Any object that is on the detail side of a master-detail relationship. D. Any object that is on the child side of a lookup relationship. Correct Answer: A Explanation QUESTION 80 A developer runs the following anonymous code block:List acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ `, ` +Limits.getLimitDMLStatements ());What is the result? A. 11, 150 B. 150, 2 C. 150, 11 D. 2, 150 Correct Answer: D Explanation QUESTION 81 What are the supported content sources for custom buttons and links? (Choose 2 Answers) A. VisualForce Page. B. Static Resource. C. URL. D. Chatter File. E. Lightning Page. Correct Answer: AC Explanation QUESTION 82 What actions types should be configured to display a custom success message? A. Update a record. B. Post a feed item. C. Delete a record. D. Close a case. Correct Answer: A Explanation QUESTION 83 When creating a record with a Quick Action, what is the easiest way to post a feed item? A. By selecting create feed item on the quick action. B. By adding a trigger on the new record. C. By adding a workflow rule on the new record. D. By selecting create case feed on the new record. Correct Answer: A Explanation QUESTION 84 What is the easiest way to verify a user before showing them sensitive content? A. Sending the user a SMS message with a passcode. B. Calling the generateVerificationUrl method in apex. C. Sending the user an Email message with a passcode. D. Calling the Session.forcedLoginUrl method in apex. Correct Answer: B Explanation QUESTION 85 What features are available when writing apex test classes?(Choose 2 Answers) A. The ability to select error types to ignore in the developer console. B. The ability to write assertions to test after a @future method. C. The ability to set and modify the CreatedDate field in apex tests. D. The ability to set breakpoints to freeze the execution at a given point. E. The ability to select testing data using csv files stored in the system. Correct Answer: CE Explanation QUESTION 86 Which two number expression evaluate correctly? Choose 2 answers A. Integer I = 3.14159; B. Decimal D = 3.14159; C. Long I = 3.14159; D. Double D =3.14159; Correct Answer: BD Explanation QUESTION 87 A visualforce interface is created for Case Management that includes both standard and custom functionality defined in an Apex class called myControllerExtension. The visualforce page should include which attribute(s) to correctly implement controller functionality? A. StandardController = "case" and extensions =" myControllerExtension" B. Extensions=" myControllerExtension" C. Controller=" myControllerExtension" D. Controller = "case" and extensions =" myControllerExtension" Correct Answer: A Explanation QUESTION 88 Before putting an app into production, which step should be taken? A. Run the production check feature via the web interface B. Switch to a production database C. Insure that you have installed a performance introspection add-on D. Scale your dynos Correct Answer: A Explanation QUESTION 89 A developer created a lightning component name accountList.cmp that display a list of Accounts. Client- side logic that is executed when a user hovers over an account in the list should be stored in which bundle member? A. AccountListHelper.js B. AccountListRenderer.js C. AccountList.renderer D. AccountList.helper Correct Answer: C Explanation QUESTION 90 A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class? A. @BeforeTest B. @isTest(SeeAllData=True) C. @TestSetup D. @PreTest Correct Answer: C Explanation QUESTION 91 Given the code block: Integer x; For(x=0;x with one element D. As a set< string > with one element Correct Answer: B Explanation QUESTION 99 Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers A. String qryName = '%' + String.enforceSecurityChecks(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString); B. String qryName = '%' + name '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString); C. String qryName = '%' + String.escpaeSingleQuotes(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString); D. String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString); Correct Answer: AD Explanation QUESTION 100 What is the return data type when ApexPages.currentPage().getParameters() is used to retrieve URL parameters from a visualforce controller? A. Map B. List C. Enum D. String[] Correct Answer: A Explanation QUESTION 101 A developer needs to write a method that searches for a phone number that could be on multiple object types. Which method should the developer use to accomplish this task? A. SOQL Query that includes ALL ROWS B. SOQL query on each object C. SOSL Query that includes ALL ROWS D. SOSL query on each object Correct Answer: C Explanation QUESTION 102 What is accurate statement about with sharing keyword? Choose 2 answers A. Either inner or outer classes can be declared as with sharing, but not both B. Both inner and outer classes can be declared as with sharing C. Inner classes do not inherit the sharing settings from the container class D. Inner classes inherit the sharing settings from the container class. Correct Answer: BC Explanation QUESTION 103 What must the Controller for a Visulforce page utilized to override the standard Opportunity view button? A. A constructor that initialized a private Opportunity variable. B. A callback constructor to reference the StandardController C. The StandardSetController to support related lists for pagination D. The Opportunity StandardController for pre-built functionality Correct Answer: D Explanation QUESTION 104 When the value of a field of an account record is updated, which method will update the value of a custom field opportunity? Choose 2 answers. A. A process builder on the Account object B. An Apex trigger on the Account object. C. A cross-object formula field on the Account object D. A workflow rule on the Account object Correct Answer: AB Explanation QUESTION 105 The sales management team requires that the lead source field of the Lead record be populated when Lead is converted. What would a developer use to ensure that a user populates the Lead source field? A. Validation rule B. Formula field C. Workflow rule D. Process builder Correct Answer: A Explanation QUESTION 106 What declarative method helps ensure quality data? Choose 3 answers A. Page layouts B. Lookup filters C. Exception handling D. Workflow alerts E. Validation rules Correct Answer: ABE Explanation QUESTION 107 What is true of a partial sandbox that is not true of a full sandbox? Choose 2 answers A. More frequent refreshes B. Limited to 5 GB of data C. Use of change sets D. Only includes necessary meta data Correct Answer: AB Explanation QUESTION 108 In Lightning component framework, which resource can be used to fire events? Choose 2 answers. A. Third-party Javascript code B. Javascript controller actions C. Visualforce controller actions D. Third-party web service code Correct Answer: AB Explanation QUESTION 109 What is the advantage of Salesforce Lightning? A. Uses service side for better handling B. Option 4 C. Pre-defined components to give Standard Look and Feel D. Option 3 Correct Answer: C Explanation QUESTION 110 What are two considerations for deciding to use a roll-up summary field? Choose 2 answer's partner. A. Roll-up summary can be performed on formula fields, but if their formula contains an #Error result, it may affect the summary value. B. Roll-up summary fields do not cause validation rules on the parent object unless that object is edited separately. C. Roll-up cannot be performed on formula fields. D. Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW(). Correct Answer: AD Explanation Explanation/Reference: Exam D QUESTION 1 Which statement results in an Apex compiler error? A. Map lmap = new Map([Select ID from Lead Limit 8]); B. Date d1 = Date.Today(), d2 = Date.ValueOf(`2018-01-01'); C. Integer a=5, b=6, c, d = 7; D. List s = List{`a',`b',`c'); Correct Answer: D Explanation QUESTION 2 What are two benefits of the Lightning Component framework? (Choose two.) A. It simplifies complexity when building pages, but not applications. B. It provides an event-driven architecture for better decoupling between components. C. It promotes faster development using out-of-box components that are suitable for desktop and mobile devices. D. It allows faster PDF generation with Lightning components. Correct Answer: BC Explanation QUESTION 3 A method is passed a list of generic sObjects as a parameter. What should the developer do to determine which object type (Account, Lead, or Contact, for example) to cast each sObject? A. Use the first three characters of the sObject ID to determine the sObject type. B. Use the getSObjectType method on each generic sObject to retrieve the sObject token. C. Use the getSObjectName method on the sObject class to get the sObject name. D. Use a try-catch construct to cast the sObject into one of the three sObject types. Correct Answer: B Explanation QUESTION 4 What should a developer use to implement an automatic Approval Process submission for Cases? A. An Assignment Rule B. Scheduled Apex C. Process Builder D. A Workflow Rule Correct Answer: C Explanation QUESTION 5 When viewing a Quote, the sales representative wants to easily see how many discounted items are included in the Quote Line Items. What should a developer do to meet this requirement? A. Create a trigger on the Quote object that queries the Quantity field on discounted Quote Line Items. B. Create a Workflow Rule on the Quote Line Item object that updates a field on the parent Quote when the item is discounted. C. Create a roll-up summary field on the Quote object that performs a SUM on the quote Line Item Quantity field, filtered for only discounted Quote Line Items. D. Create a formula field on the Quote object that performs a SUM on the Quote Line Item Quantity field, filtered for only discounted Quote Line Items. Correct Answer: C Explanation QUESTION 6 While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org. How should the Developer overcome this problem? A. Use Test.getStandardPricebookId() to get the standard PriceBook ID. B. Use @IsTest(SeeAllData=true) and delete the existing standard PriceBook. C. Use Test.loadData() and a Static Resource to load a standard Pricebook. D. Use @TestVisible to allow the test method to see the standard PriceBook. Correct Answer: A Explanation QUESTION 7 Which two Apex data types can be used to reference a Salesforce record ID dynamically? (Choose two.) A. ENUM B. sObject C. External ID D. String Correct Answer: AD Explanation QUESTION 8 Where can a developer identify the time taken by each process in a transaction using Developer Console log inspector? A. Performance Tree tab under Stack Tree panel B. Execution Tree tab under Stack Tree panel C. Timeline tab under Execution Overview panel D. Save Order tab under Execution Overview panel Correct Answer: C Explanation QUESTION 9 Which two platform features align to the Controller portion of MVC architecture? (Choose two.) A. Process Builder actions B. Workflow rules C. Standard objects D. Date fields Correct Answer: AB Explanation QUESTION 10 A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage. Production data is not required for the integration testing. Which two environments meet the requirements for testing? (Choose two.) A. Developer Sandbox B. Full Sandbox C. Developer Edition D. Partial Sandbox E. Developer Pro Sandbox Correct Answer: BD Explanation QUESTION 11 A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master-Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively? A. A Visualforce page that calculates the total number of hours for a timecard and displays it on the page B. A Roll-Up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard C. A Process Builder process that updates a field on the timecard when a timecard entry is created D. An Apex trigger that uses an Aggregate Query to calculate the hours for a given timecard and stores it in a custom field Correct Answer: B Explanation QUESTION 12 A developer encounters APEX heap limit errors in a trigger. Which two methods should the developer use to avoid this error? (Choose two.) A. Use the transient keyword when declaring variables. B. Query and store fields from the related object in a collection when updating related objects. C. Remove or set collections to null after use. D. Use SOQL for loops instead of assigning large queries results to a single collection and looping through the collection. Correct Answer: AD Explanation QUESTION 13 Which approach should be used to provide test data for a test class? A. Query for existing records in the database. B. Execute anonymous code blocks that create data. C. Use a test data factory class to create test data. D. Access data in @TestVisible class variables. Correct Answer: C Explanation QUESTION 14 Which approach should a developer take to automatically add a "Maintenance Plan" to each Opportunity that includes an "Annual Subscription" when an opportunity is closed? A. Build a OpportunityLineItem trigger that adds a PriceBookEntry record. B. Build an OpportunityLineItem trigger to add an OpportunityLineItem record. C. Build an Opportunity trigger that adds a PriceBookEntry record. D. Build an Opportunity trigger that adds an OpportunityLineItem record. Correct Answer: D Explanation QUESTION 15 Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.) A. Records created in the test setup method cannot be updated in individual test methods. B. Qo The @testSetup annotation is not supported when the GisTest(SeeAllData=True) annotation is used. C. Test data is inserted once for all test methods in a class. D. A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits. Correct Answer: BD Explanation Explanation/Reference: QUESTION 16 What is the requirement for a class to be used as a custom Visualforce controller? A. Any top-level Apex class that has a constructor that returns a PageReference B. Any top-level Apex class that extends a PageReference C. Any top-level Apex class that has a default, no-argument constructor D. Any top-level Apex class that implements the controller interface Correct Answer: D Explanation QUESTION 17 A Visualforce page is required for displaying and editing Case records that includes both standard and custom functionality defined in an Apex class called myControllerExtension. The Visualforce page should include which attribute(s) to correctly implement controller functionality? A. controller="Case" and extensions="myControllerExtension" B. extensions="myControllerExtension" C. controller="myControllerExtension" D. standardController="Case" and extensions="myControllerExtension" Correct Answer: D Explanation QUESTION 18 A newly hired developer discovers that there are multiple triggers on the case object. What should the developer consider when working with triggers? A. Developers must dictate the order of trigger execution. B. Trigger execution order is based on creation date and time. C. Unit tests must specify the trigger being tested. D. Trigger execution order is not guaranteed for the same sObject. Correct Answer: D Explanation QUESTION 19 How should a developer prevent a recursive trigger? A. Use a "one trigger per object" pattern. B. Use a static Boolean variable. C. Use a trigger handler. D. Use a private Boolean variable. Correct Answer: D Explanation QUESTION 20 Which three options can be accomplished with formula fields? (Choose three.) A. Generate a link using the HYPERLINK function to a specific record. B. Display the previous value for a field using the PRIORVALUE function. C. Determine if a datetime field value has passed using the NOW function. D. Return and display a field value from another object using the VLOOKUP function. E. Determine which of three different images to display using the IF function. Correct Answer: ACE Explanation QUESTION 21 What is a capability of the tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.) A. Loading files from Documents. B. One-time loading for duplicate scripts. C. Specifying loading order. D. Loading scripts in parallel. E. Loading externally hosted scripts. Correct Answer: BCD Explanation QUESTION 22 A Platform Developer needs to write an Apex method that will only perform an action if a record is assigned to a specific Record Type. Which two options allow the developer to dynamically determine the ID of the required Record Type by its name? (Choose two.) A. Make an outbound web services call to the SOAP API. B. Hardcode the ID as a constant in an Apex class. C. Use the getRecordTypeInfosByName() method in the DescribeSObjectResult class. D. Execute a SOQL query on the RecordType object. Correct Answer: CD Explanation QUESTION 23 A developer has the controller class below. Which code block will run successfully in an execute anonymous window? A. myFooController m = new myFooController();System.assert(m.prop !=null); B. myFooController m = new myFooController();System.assert(m.prop ==0); C. myFooController m = new myFooController();System.assert(m.prop ==null); D. myFooController m = new myFooController();System.assert(m.prop ==1); Correct Answer: C Explanation QUESTION 24 In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex? A. As a List with each value as an element in the list B. As a String with each value separated by a comma C. As a String with each value separated by a semicolon D. As a Set with each value as an element in the set Correct Answer: C Explanation QUESTION 25 A developer writes the following code: What is the result of the debug statement? A. 1, 100 B. 1, 150 C. 2, 150 D. 2, 200 Correct Answer: C Explanation QUESTION 26 What are two valid options for iterating through each Account in the collection List named AccountList? (Choose two.) A. for (Account theAccount : AccountList) {...} B. for(AccountList) {...} C. for (List L : AccountList) {...} D. for (Integer i=0; i < AccountList.Size(); i++) {...} Correct Answer: AD Explanation QUESTION 27 Given: Map accountMap = new Map>ID, Account> ([SELECT Id, Name FROM Account]); What are three valid Apex loop structures for iterating through items in the collection? (Choose three.) A. for (ID accountID : accountMap.keySet()) {...} B. for (Account accountRecord : accountMap.values()) {...} C. for (Integer i=0; I < accountMap.size(); i++) {...} D. for (ID accountID : accountMap) {...} E. for (Account accountRecord : accountMap.keySet()) {...} Correct Answer: ABC Explanation QUESTION 28 Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage. Which two strategies should a developer use to accomplish this? (Choose two.) A. Use a Visual Workflow. B. Use a validation rule. C. Use the Process Automation Settings. D. Use a Trigger. Correct Answer: BD Explanation QUESTION 29 How should a developer make sure that a child record on a custom object, with a lookup to the Account object, has the same sharing access as its associated account? A. Create a Sharing Rule comparing the custom object owner to the account owner. B. Create a validation rule on the custom object comparing the record owners on both records. C. Include the sharing related list on the custom object page layout. D. Ensure that the relationship between the objects is Master-Detail. Correct Answer: D Explanation QUESTION 30 An org has a single account named `NoContacts' that has no related contacts. Given the query: List accounts = [Select ID, (Select ID, Name from Contacts) from Account where Name=`NoContacts']; What is the result of running this Apex? A. accounts.contacts is invalid Apex. B. accounts.contacts is an empty Apex. C. accounts.contacts is Null. D. A QueryException is thrown. Correct Answer: B Explanation QUESTION 31 A platform developer at Universal Containers needs to create a custom button for the Account object that, when clicked, will perform a series of calculations and redirect the user to a custom Visualforce page. Which three attributes need to be defined with values in the tag to accomplish this? (Choose three.) A. action B. renderAs C. standardController D. readOnly E. extensions Correct Answer: BCE Explanation Explanation/Reference: QUESTION 32 Using the Schema Builder, a developer tries to change the API name of a field that is referenced in an Apex test class. What is the end result? A. The API name is not changed and there are no other impacts. B. The API name of the field and the reference in the test class is changed. C. The API name of the field is changed, and a warning is issued to update the class. D. The API name of the field and the reference in the test class is updated. Correct Answer: C Explanation QUESTION 33 When is an Apex Trigger required instead of a Process Builder Process? A. When a record needs to be created B. When multiple records related to the triggering record need to be updated C. When a post to Chatter needs to be created D. When an action needs to be taken on a delete or undelete, or before a DML operation is executed. Correct Answer: D Explanation QUESTION 34 A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent. Which action will allow the developer to relate records in the data model without knowing the Salesforce ID? A. Create and populate a custom field on the parent object marked as Unique. B. Create a custom field on the child object of type External Relationship. C. Create and populate a custom field on the parent object marked as an External ID. D. Create a custom field on the child object of type Foreign Key. Correct Answer: C Explanation Explanation/Reference: QUESTION 35 A developer created a Lightning component to display a short text summary for an object and wants to use it with multiple Apex classes. How should the developer design the Apex classes? A. Have each class define method getObject() that returns the sObject that is controlled by the Apex class. B. Extend each class from the same base class that has a method getTextSummary() that returns the summary. C. Have each class implement an interface that defines method getTextSummary() that returns the summary. D. Have each class define method getTextSummary() that returns the summary. Correct Answer: C Explanation Explanation/Reference: QUESTION 36 Which approach should a developer use to add pagination to a Visualforce page? A. A StandardController B. The Action attribute for a page C. The extensions attribute for a page D. A StandardSetController Correct Answer: D Explanation QUESTION 37 A developer is asked to create a PDF quote document formatted using the company's branding guidelines, and automatically save it to the Opportunity record. Which two ways should a developer create this functionality? (Choose two.) A. Install an application from the AppExchange to generate documents. B. Create a Visualforce page with custom styling. C. Create an email template and use it in Process Builder. D. Create a visual flow that implements the company's formatting. Correct Answer: AB Explanation QUESTION 38 Which tool allows a developer to send requests to the Salesforce REST APIs and view the responses? A. REST resource path URL B. Workbench REST Explorer C. Developer Console REST tab D. Force.com IDE REST Explorer tab Correct Answer: B Explanation QUESTION 39 A developer created a Visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page. What should the developer do to deploy to production? A. Create a test class that provides coverage of the Visualforce page. B. Create a test page that provides coverage of the Visualforce page. C. Create a test page that provides coverage of the custom controller. D. Create a test class that provides coverage of the custom controller. Correct Answer: D Explanation QUESTION 40 What is a benefit of using an after insert trigger over using a before insert trigger? A. An after insert trigger allows a developer to bypass validation rules when updating fields on the new record. B. An after insert trigger allows a developer to insert other objects that reference the new record. C. An after insert trigger allows a developer to make a callout to an external service. D. An after insert trigger allows a developer to modify fields in the new record without a query. Correct Answer: B Explanation QUESTION 41 The operation manager at a construction company uses a custom object called Machinery to manage the usage and maintenance of its cranes and other machinery. The manager wants to be able to assign machinery to different constructions jobs, and track the dates and costs associated with each job. More than one piece of machinery can be assigned to one construction job. What should a developer do to meet these requirements? A. Create a lookup field on the Construction Job object to the Machinery object. B. Create a lookup field on the Machinery object to the Construction Job object. C. Create a junction object with Master-Detail Relationship to both the Machinery object and the Construction Job object. D. Create a Master-Detail Lookup on the Machinery object to the Construction Job object. Correct Answer: A Explanation QUESTION 42 Which two strategies should a developer use to avoid hitting governor limits when developing in a multi- tenant environment? (Choose two.) A. Use collections to store all fields from a related object and not just minimally required fields. B. Use methods from the "Limits" class to monitor governor limits. C. Use SOQL for loops to iterate data retrieved from queries that return a high number of rows. D. Use variables within Apex classes to store large amounts of data. Correct Answer: BC Explanation Explanation/Reference: QUESTION 43 Which set of roll-up types are available when creating a roll-up summary field? A. COUNT, SUM, MIN, MAX B. AVERAGE, SUM, MIN, MAX C. SUM, MIN, MAX D. AVRAGE, COUNT, SUM, MIN, MAX Correct Answer: A Explanation QUESTION 44 What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code? A. Account0.Phone=333-8781, Account1.Phone=333-8780 B. Account0.Phone=888-1515, Account1.Phone=999-2525 C. Account0.Phone=333-8780, Account1.Phone=333-8781 D. Account0.Phone=888-1515, Account1.Phone=999-1515 Correct Answer: C Explanation QUESTION 45 Which three options allow a developer to use custom styling in a Visualforce page? (Choose three.) A. tag B. Inline CSS C. tag D. tag E. A static resource Correct Answer: ABE Explanation QUESTION 46 A developer executes the following query in Apex to retrieve a list of contacts for each account: List accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ; Which two exceptions may occur when it executes? (Choose two.) A. CPU limit exception due to the complexity of the query. B. SOQL query row limit exception due to the number of contacts. C. SOQL query limit exception due to the number of contacts. D. SOQL query row limit exception due to the number of accounts. Correct Answer: CD Explanation Explanation/Reference: QUESTION 47 Which three tools can deploy metadata to production? (Choose three.) A. Change Set from Developer Org B. Force.com IDE C. Data Loader D. Change Set from Sandbox E. Metadata API Correct Answer: ADE Explanation QUESTION 48 A developer needs to display all of the available fields for an object. In which two ways can the developer retrieve the available fields if the variable myObject represents the name of the object? (Choose two.) A. Use myObject.sObjectType.getDescribe().fieldSet() to return a set of fields. B. Use mySObject.myObject.fields.getMap() to return a map of fields. C. Use Schema.describeSObjects(new String[]{myObject}).fields.getMap() to return a map of fields. D. Use getGlobalDescribe().get(myObject).getDescribe().fields.getMap() to return a map of fields. Correct Answer: BC Explanation QUESTION 49 How should a developer avoid hitting the governor limits in test methods? A. Use @TestVisible on methods that create records. B. Use Test.loadData() to load data from a static resource. C. Use @IsTest (SeeAllData=true) to use existing data. D. Use Test.startTest() to reset governor limits. Correct Answer: D Explanation QUESTION 50 Which three declarative fields are correctly mapped to variable types in Apex? (Choose three.) A. Number maps to Decimal. B. Number maps to Integer. C. TextArea maps to List of type String. D. Date/Time maps to Dateline. E. Checkbox maps to Boolean. Correct Answer: ADE Explanation QUESTION 51 A developer is asked to set a picklist field to `Monitor' on any new Leads owned by a subnet of Users. How should the developer implement this request? A. Create an after insert Lead trigger. B. Create a before insert Lead trigger. C. Create a Lead Workflow Rule Field Update. D. Create a Lead formula field. Correct Answer: C Explanation QUESTION 52 Why would a developer consider using a custom controller over a controller extension? A. To increase the SOQL query governor limits. B. To implement all of the logic for a page and bypass default Salesforce functionality C. To leverage built-in functionality of a standard controller D. To enforce user sharing settings and permissions Correct Answer: B Explanation QUESTION 53 A developer wants to override a button using Visualforce on an object. What is the requirement? A. The controller or extension must have a PageReference method. B. The standardController attribute must be set to the object. C. The action attribute must be set to a controller method. D. The object record must be instantiated in a controller or extension. Correct Answer: B Explanation QUESTION 54 A lead object has a custom field Prior_Email_c. The following trigger is intended to copy the current Email into the Prior_Email_c field any time the Email field is changed: Which type of exception will this trigger cause? A. A null reference exception B. A compile time exception C. A DML exception D. A limit exception when doing a bulk update Correct Answer: C Explanation Explanation/Reference: QUESTION 55 How should a developer create a new custom exception class? A. public class CustomException extends Exception{} B. CustomException ex = new (CustomException)Exception(); C. public class CustomException implements Exception{} D. (Exception)CustomException ex = new Exception(); Correct Answer: A Explanation QUESTION 56 Which two number expressions evaluate correctly? (Choose two.) A. Double d = 3.14159; B. Integer I = 3.14159; C. Decimal d = 3.14159; D. Long l = 3.14159; Correct Answer: AC Explanation QUESTION 57 How can a developer set up a debug log on a specific user? A. It is not possible to setup debug logs for users other than yourself. B. Ask the user for access to their account credentials, log in as the user and debug the issue. C. Create Apex code that logs code actions into a custom object. D. Set up a trace flag for the user, and define a logging level and time period for the trace. Correct Answer: D Explanation QUESTION 58 A developer needs to create a Visualforce page that displays Case dat. The page will be used by both support reps and support managers. The Support Rep profile does not allow visibility of the Customer_Satisfaction_c field, but the Support Manager profile does. How can the developer create the page to enforce Field Level Security and keep future maintenance to a minimum? A. Create one Visualforce Page for use by both profiles. B. Use a new Support Manager permission set. C. Create a separate Visualforce Page for each profile. D. Use a custom controller that has the with sharing keywords. Correct Answer: D Explanation Explanation/Reference: QUESTION 59 When an Account's custom picklist field called Customer Sentiment is changed to a value of "Confused", a new related Case should automatically be created. Which two methods should a developer use to create this case? (Choose two.) A.

Use Quizgecko on...
Browser
Browser