Platform Developer I Mock 2

Welcome to your Platform Developer I Mock 2

An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use. What is the correct definition of a Lightning Web component property that uses the getAccounts method?

Refer to the following code snippet for an environment has more than 200 Accounts belonging to the 'Technology' industry: for(Account thisAccount : [Select Id, Industry FROM Account LIMIT 150]){ if(thisAccount.Industry == 'Technology' ){ thisAccount.Is_Tech__c = true; } update thisAccount; } When he code executes which two events occur as a result of the Apex transaction? Choose 2 answers

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 2 answers

What is the result of the following code? Account a = new Account( ); Database. insert(a, false)

A developer needs to create a custom interface in Apex. Which three considerations must the developer keep in mind while developing the Apex interface? Choose 3 answers

What will be the output in the debug log in the event of a QueryException during a call to the aQuery method in the following example? class myClass { class CustomException extends QueryException { } public static Account aQuery( ) { Account theAccount; try { system. debug( ' Querying Accounts. '); theAccount = [SELECT Id FROM Account WHERE CreatedDate > TODAY] ; } catch (CustomException eX) { system.debug(' Custom Exception. '); } catch (QueryException eX) { system.debug('Query Exception. '); } finally { system.debug('Done. '); } return theAccount ; } }

A developer wants to invoke an outbound message when a record meets a specific criteria. Which three features satisfy this use case? Choose 3 answers

A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record. How can the developer find the current user's default record type?

The sales management team at Universal Containers requires that the Lead Source field of the Lead record be populated when a Lead is converted. What should be used to ensure that user populates the Lead Source field prior to converting a Lead?

What is the result of the following code snippet? public void doWork(Account acct){ for (Integer i = 0; i <= 200; i++){ insert acct; } }

How many Accounts will be inserted by the following block of code? for(Integer i = 0; i< 500; i++){ Account a = new Account (Name= 'New Account ' +i); insert a; }

What are two ways that a controller extension can be specified on a Visualforce page? Choose 2 answers

How does the Lightning Component framework help developers implement solutions faster?

Which two are best practices when it comes to Aura components and application event handling? Choose 2 answers

A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public with sharing class customCtrlr { private Account theAccount; public String actType; public customCtrlr( ) { theAccount = [SELECT Id, Type FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('Id')]; actType = theAccount.Type; } } 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?

Which action causes a before trigger to fire by default for Accounts?

How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Which three web technologies can be integrated into a Visualforce page?

Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers

A developer needs to create a baseline set of data(Accounts, Contacts, Products, Assets) for an entire suite of tests allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test?

Which two statements are true about using the @testSetup annotation in an Apex test class? Choose 2 answers

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?

While working in a sandbox an Apex test fails when run in the Test Framework, but the Apex test logic succeeds with no exceptions or errors when run in the Developer Console. Why did the method fail in the sandbox test framework but succeed in the Developer Console?

When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles. Which two tools can they use to run a script that deploys to a sandbox? Choose 2 answers

Which scenario is valid for execution by unit tests?

Which Salesforce org has a complete duplicate copy of the production org including data and configuration?

How can a developer check the test coverage of active Process Builders and Flows before deploying them in a Change Set?

While writing an Apex class that creates Accounts, a developer wants to make sure that all required fields are handled properly. Which approach should the developer use to be sure that the Apex class works correctly?

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 developer is integrating with a legacy on-premise SQL database. What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?

A developer is migrating a Visualforce page into a Lightning web component. The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data. Which security consideration should the developer be aware of

UC uses a Master-Detail relationship and stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available. Which method should be used to calculate the estimated ship date for an Order?

A developer created these three roll-up summary fields on the custom object, Project__c: Total_Timesheets__c Total_Approved_Timesheets__c Total_Rejected_Timesheet__c The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project. What are two benefits of choosing a formula field instead of an Apex trigger to fulfill the request? Choose 2 answers

What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "UC"?

The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists across different objects. What is an approach a developer can take to streamline maintenance of the picklists and their values, while also restricting the values to the ones mentioned above?

When importing and exporting data into Salesforce, Which two statement are true? Choose 2 answers

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?

What is an example of a polymorphic lookup field in Salesforce?

A PrimaryId__c custom field exists on the Candidate__c custom object. The field is used to store each candidate's id number and is marked as Unique in the schema definition. As part of a data enrichment process, UC has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's primary id as a data point. UC wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should the developer implement to streamline the data upload?

What is fundamental different between a Mater-Detail relationship and a Lookup relationship?

A SSN__c custom field exists on the Candidate __c custom object. The field is used to store each candidate's social security number and is marked as Unique in the schema definition. As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's social security number as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should the developer implement to streamline the data upload?

A developer wants to import 500 Opportunity records into a sandbox. Why should the developer choose to use Data Loader instead of Data Import Wizard?

Which two are phases in the Aura application event propagation framework? Choose 2 answers

UC wants Opportunities to no longer be editable when reaching the Closed/Won stage. How should a developer accomplish this?

A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration that reads task records is periodically reporting errors. Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?

Which annotation exposes an Apex class as a RESTful web service?

UC hires a developer to built a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field. Which consideration should the developer be aware of when deciding between SOQL and SOSL? Choose 2 answers.

What is the value of the Trigger.old context variable in a Before Insert trigger?

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug( 'Campaign ID' + ar.get('CampaignId')); System.debug( 'Average amount' + ar.get('expr0')); } Example 2: AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug( 'Campaign ID' + ar.get('CampaignId')); System.debug( 'Average amount' + ar.get('theAverage')); } Example 3: AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug( 'Campaign ID' + ar.get('CampaignId')); System.debug( 'Average amount' + ar.get.AVG()); } Example 4: AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults) { System.debug( 'Campaign ID' + ar.get('CampaignId')); System.debug( 'Average amount' + ar.theAverage); } Which two examples above use the System.debug statements to correctly display the results from the SOQL aggregate queries? Choose 2 answers

A developer receives an error when trying to call a global server-side method using the @remoteAction decorator. How can the developer resolve the error?

An Approval Process is defined in the Expense_Item__c object. A business rule dictates that whenever a user changes the Status to 'Submitted' on an Expense_Export__c record, all the Expense_Item__c records related to the expense report must enter the approval process individually. What approach should be used to ensure the business requirement is met?

A workflow updates the value of a custom field for an existing Account. How can a developer access the updated custom field value from a trigger?

In the following example, which sharing context will myMethod execute when it is invoked? public Class myClass { public void myMethod( ) { /* implementation */ } }

Which action may cause triggers to fire?

Instead of sending emails to support personnel directly from Salesforce, UC wants to notify an external system in the event that an unhandled exception occurs. What is the appropriate publish/subscribe logic to meet this requirement?