Rosa Alayon
Quiz by , created more than 1 year ago

Quiz on Developer I Pack 02, created by Rosa Alayon on 21/08/2019.

1357
0
0
Rosa Alayon
Created by Rosa Alayon over 4 years ago
Close

Developer I Pack 02

Question 1 of 73

1

In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers

Select one or more of the following:

  • before insert

  • before update

  • after insert

  • after update

Explanation

Question 2 of 73

1

A developer wants multiple test classes to use the same set of test data. How should the developer create the test data?

Select one or more of the following:

  • Reference a test utility class in each test class.

  • Use the SeeAllData=true annotation in each test class.

  • Create a Test Setup method for each test class.

  • Define variables for test records in each test class.

Explanation

Question 3 of 73

1

Account acct = (SELECT Id FROM Account LIMIT 1];
Given the code above, how can a developer get the type of object from acct?

Select one or more of the following:

  • Call "acct.getSObjectType()".

  • Call "Account.getSObjectType()".

  • Call "Account.SObjectType".

  • Call "acct.SObjectType".

Explanation

Question 4 of 73

1

Which two statements can a developer use to throw a custom exception of type MissingFieldValueException? Choose 2 answers

Select one or more of the following:

  • throw (MissingFieldValueException, 'Problem occurred');

  • throw new MissingFieldValueException('Problem occurred');

  • throw new MissingFieldValueException();

  • throw Exception(new MissingFieldValueException());

Explanation

Question 5 of 73

1

Given the code block:
Integer x; for(x = 0; x<10; x+=2)
if(x==8) break; if(x==10) break;
} system.debug(x);
Which value will the system.debug statement display?

Select one or more of the following:

  • 4

  • 2

  • 8

  • 10

Explanation

Question 6 of 73

1

Which three statements are accurate about variable scope? Choose 3 answers

Select one or more of the following:

  • Parallel blocks can reuse the same variable name

  • A sub-block can reuse a parent block's variable name if it is static.

  • A variable can be declared at any point in a block.

  • A variable must be declared before it can be referenced in a block.

  • A sub-block can reuse a parent block's variable name if it is not static.

Explanation

Question 7 of 73

1

To which primitive data type is a Text Area (Rich) field automatically assigned?

Select one or more of the following:

  • Text

  • Blob

  • Object

  • String

Explanation

Question 8 of 73

1

Which three methods help ensure quality data? Choose 3 answers

Select one or more of the following:

  • Creating a lookup filter

  • Adding an error to a field in a before trigger.

  • Sending an email alert using a workflow rule

  • Handling an exception in Apex.

  • Adding a validation rule

Explanation

Question 9 of 73

1

Which standard field is required when creating a new Contact record?

Select one or more of the following:

  • LastName

  • Name

  • AccountId

  • FirstName

Explanation

Question 10 of 73

1

From which two locations can a developer determine the overall code coverage for a sandbox? Choose 2 answers

Select one or more of the following:

  • The Test Suite Run panel of the Developer Console

  • The Apex classes setup page

  • The Apex Test Execution page

  • The Tests tab of the Developer Console

Explanation

Question 11 of 73

1

A visualforce page uses the Contact standard controller. How can a developer display the Name from the parent Account record on the page?

Select one or more of the following:

  • Use SOQL syntax to find the related Accounts Name field.

  • Use the {!contact.Account.Name} merge field syntax.

  • Use an additional standard controller for Accounts.

  • Use additional Apex logic within the controller to query for the Name field.

Explanation

Question 12 of 73

1

Which type of code represents the View in the MVC architecture on the Force.com platform?

Select one or more of the following:

  • An Apex method in an extension that returns a list of Cases

  • An Apex method that executes SOQL to retrieve a list of Cases

  • A Visualforce page that displays information about Case records by iterating over a list of Cases.

  • Validation rules for a page layout that includes a related list of Cases

Explanation

Question 13 of 73

1

What is the data type returned by the following SOSL search? [FIND 'Acme*' IN NAME FIELDS RETURNING Account, Opportunity];

Select one or more of the following:

  • List<List<Account>, List<Opportunity»

  • Map<sObject, sObject>

  • Map<Id, sObject>

  • List<List<sObject»

Explanation

Question 14 of 73

1

A developer runs the following anonymous code block in a Salesforce org with 100 Accounts.
List<Account> acc = (SELECT Id FROM Account LIMIT 10]; Delete acc; Database.emptyRecycleBin(acc); system.debug(Limits.getLimitQueries()+', '+Limits.getLimitDMIStatements());
What is the debug output?

Select one or more of the following:

  • 1, 2

  • 10, 2

  • 100, 150

  • 150, 100

Explanation

Question 15 of 73

1

A developer is creating an enhancement to an application that will allow people to be related to their employer. Which data model provides the simplest solution to meet the requirements?

Select one or more of the following:

  • Create a lookup relationship to indicate that a person has an employer.

  • Create a master-detail relationship to indicate that a person has an employer.

  • Create a junction object to relate many people to many employers through master-detail relationships.

  • Create a junction object to relate many people to many employers through lookup relationships.

Explanation

Question 16 of 73

1

Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

Select one or more of the following:

  • String gryName = String.escapeSingleQuotes(name); String gryString = 'SELECT Id FROM Contact WHERE Name LIKE \'%' + gryName + 1%\"; List<Contact> queryResult = Database.query(qryString);

  • String qryName = '%' + String.enforceSecurityChecks(name) + '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryName; List<Contact> queryResult = Database.query(qryString);

  • String qryName = '%' + name + '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryName; List<Contact> queryResult = Database.query(qryString);

  • String gryString = 'SELECT Id FROM Contact WHERE Name LIKE \'%' + name + '%\"; List<Contact> queryResult = Database.query(qryString);

Explanation

Question 17 of 73

1

An Apex trigger fails because it exceeds governor limits. Which two techniques should a developer use to resolve the problem? Choose 2 answers

Select one or more of the following:

  • Use the Database class to handle DML operations.

  • Use Maps to reference related records.

  • Use SOQL Aggregate queries to retrieve child records.

  • Use Lists for all DML operations.

Explanation

Question 18 of 73

1

Potential home buyers working with a real estate company can make offers on multiple properties that are listed with the real estate company. Offer amounts can be modified; however, the property that has the offer cannot be modified after the offer is placed.
What should be done to associate offers with properties in the schema for the organization?

Select one or more of the following:

  • Create master-detail relationships in the Contact object to both the Property and Offer custom objects.

  • Create a lookup relationship in the Property custom object to the Offer custom object.

  • Create a master-detail relationship in the Offer custom object to the Property custom object.

  • Create a lookup relationship in the Offer custom object to the Property custom object.

Explanation

Question 19 of 73

1

What are two benefits of the Lightning Component framework?
Choose 2 answers

Select one or more of the following:

  • It provides an event-driven architecture for better decoupling between components.

  • It allows faster PDF generation with Lightning components

  • it simplifies complexity when building pages, but not applications.

  • It promotes faster development using out-of-the-box components that are suitable for desktop and mobile devices.

Explanation

Question 20 of 73

1

What is the debug output of the following Apex code?
Decimal theValue; System.debug(theValue);

Select one or more of the following:

  • Undefined

  • 0

  • null

  • 0.0

Explanation

Question 21 of 73

1

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;

Select one or more of the following:

  • Add the SeeAllData annotation to the test class.

  • Add the TestVisible annotation to recordCount.

  • Change recordCount from private to public.

  • Add the TestVisible annotation to the MyController class

Explanation

Question 22 of 73

1

A developer needs to save a List of existing Account records named myAccounts to the database, but the records do not contain Salesforce Id values. Only the value of a custom text field configured as an External ID with an API name of Foreign_Key_c is known. Which two statements enable the developer to save the records to the database without an Id? Choose 2 answers

Select one or more of the following:

  • Database.upsert (myAccounts, Foreign_Key_c);

  • Database.upsert(myAccounts).Foreign_Key c;

  • Upsert myAccounts(Foreign_Key c);

  • Upsert myAccounts Foreign_Key_c;

Explanation

Question 23 of 73

1

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 place.
What could be causing this?

Select one or more of the following:

  • The field is being populated by a workflow field update.

  • A DML exception is occurring during the save order of execution.

  • The field is being populated by a before trigger.

  • The user belongs to a permission set that suppresses the validation rule.

Explanation

Question 24 of 73

1

How can a developer set up a debug log on a specific user?

Select one or more of the following:

  • Setup a trace flag for the user, and define a logging level and time period for the trace.

  • Ask the user for access to their account credentials, log in as the user and debug the issue.

  • Create Apex code that logs code actions into a custom object.

  • It is not possible to setup debug logs for users other than yourself.

Explanation

Question 25 of 73

1

A developer needs to update an unrelated object when a record gets saved.
Which two trigger types should the developer create? Choose 2 answers

Select one or more of the following:

  • after insert

  • after update

  • before update

  • before insert

Explanation

Question 26 of 73

1

What can be used to delete components from production?

Select one or more of the following:

  • A change set deployment with the delete option checked

  • An ant migration tool deployment with a destructiveChanges XML file and the components to delete in the package.xml file

  • A change set deployment with a destructiveChanges XML file

  • An ant migration tool deployment with a destructiveChanges XML file and an empty package.xml file

Explanation

Question 27 of 73

1

Given the code below, which three statements can be used to create the controller variable?
public class AccountListController {
public List<Account> getAccounts() { return controller.getRecords(); } } Choose 3 answers

Select one or more of the following:

  • ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.getQueryLocator('SELECT Id FROM Account'));

  • ApexPages.StandardController controller = new ApexPages.StandardController([SELECT Id FROM Account]);

  • ApexPages.StandardController controller = new ApexPages.StandardController(Database.getQueryLocator('SELECT Id FROM ACCOUNT'));

  • ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.query('SELECT Id FROM Account'));

  • ApexPages.StandardSetController controller = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id FROM Account]));

Explanation

Question 28 of 73

1

Which three statements are true regarding the @isTest annotation?
Choose 3 answers

Select one or more of the following:

  • Products and Pricebooks are visible in a test even if a class is annotated @isTest (SeeAnData=false) .

  • A method annotated @isTest (SeeAllData=false) in a class annotated @isTest (SeeAllData=true) has access to all org data.

  • A method annotated @isTest (SeeAllData=true) in a class annotated @isTest (SeeAllData=faise) has access to all org data.

  • Profiles are visible in a test even if a class is annotated @isTest (SeeAllData=false) .

  • A class containing test methods counts toward the Apex code limit regardless of any @isTest annotation.

Explanation

Question 29 of 73

1

Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate.
What is the best way to indicate that a combined review score of 15 or better is required to recommend that the candidate come in for an interview?

Select one or more of the following:

  • Use a Validation Rule on a total score field on the candidate record that prevents a recommended field from being true if the total score is less than 15.

  • Use a Workflow Rule to calculate the sum of the review scores and send an email to the hiring manager when the total is 15 or better.

  • Use Visual Workflow to set a recommended field on the candidate whenever the cumulative review score is 15 or better.

  • Use a Rollup Summary field to calculates the sum of the review scores, and store this in a total score field on the candidate.

Explanation

Question 30 of 73

1

A developer needs to include a Visualforce page in the detail section of a page layout for the Account object, but does not see the page as an available option in the Page Layout Editor.
Which attribute must the developer include in the <apex:page> tag to ensure the Visualforce page can be embedded in a page layout?

Select one or more of the following:

  • controller="Account"

  • extensions="AccountController"

  • standardController="Account"

  • action="AccountId"

Explanation

Question 31 of 73

1

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?

Select one or more of the following:

  • An Apex trigger that uses an Aggregate Query to calculate the hours for a given timecard and stores it in a custom field

  • A Visualforce page that calculates the total number of hours for a timecard and displays it on the page

  • Process Builder process that updates a field on the timecard when a timecard entry is created

  • A Roll-Up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard

Explanation

Question 32 of 73

1

What is a key difference between a Master-Detail Relationship and a Lookup Relationship?

Select one or more of the following:

  • When a record of a master object in a Lookup Relationship is deleted, the detail records are always deleted.

  • When a record of a master object in a Master-Detail Relationship is deleted, the detail records are kept and not deleted.

  • A Lookup Relationship is a required field on an object.

  • A Master-Detail Relationship detail record inherits the sharing and security of its master record.

Explanation

Question 33 of 73

1

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

Select one or more of the following:

  • Use the getRecordTypeInfosByDeveloperName() method in the DescribeSObjectResult class.

  • Make an outbound web services call to the SOAP API.

  • Execute a SOQL query on the RecordType object.

  • Hardcode the ID as a constant in an Apex class.

Explanation

Question 34 of 73

1

A developer created a Visualforce page using a custom controller that calls an Apex helper class. A method in the helper class hits a governor limit.
What is the result of the transaction?

Select one or more of the following:

  • The helper class creates a savepoint and continues.

  • All changes in the transaction are rolled back.

  • All changes made by the custom controller are saved.

  • The custom controller calls the helper class method again.

Explanation

Question 35 of 73

1

Which statement is true about a Hierarchical relationship as it pertains to User records?

Select one or more of the following:

  • It uses a junction object and lookup relationships to allow many User records to be related to many other User records.

  • It uses a junction object and master-detail relationships to allow many User records to be related to many other User records.

  • It uses a master-detail relationship to allow one User record to be related to another User record.

  • It uses a special lookup relationship to allow one User record to be related to another User record.

Explanation

Question 36 of 73

1

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?

Select one or more of the following:

  • Create a test page that provides coverage of the custom controller.

  • Create a test page that provides coverage of the Visualforce page.

  • Create a test class that provides coverage of the Visualforce page.

  • Create a test class that provides coverage of the custom controller.

Explanation

Question 37 of 73

1

Which three data types can be returned from an SOQL statement?

Select one or more of the following:

  • Boolean

  • List of sObjects

  • String

  • Integer

  • Single sObject

Explanation

Question 38 of 73

1

In order to override a standard action with a Visualforce page, which attribute must be defined in the <apex:page> tag?

Select one or more of the following:

  • pageReference

  • override

  • standardController

  • controller

Explanation

Question 39 of 73

1

What is a benefit of using a trigger framework?

Select one or more of the following:

  • Simplifies addition of context-specific logic

  • Allows functional code to be tested by a test class

  • Increases trigger governor limits

  • Reduces trigger execution time

Explanation

Question 40 of 73

1

What are three techniques that a developer can use to invoke an anonymous block of code? Choose 3 answers

Select one or more of the following:

  • Create a Visualforce page that uses a controller class that is declared without sharing.

  • Type code into the Developer Console and execute it directly.

  • Type code into the Execute Anonymous tab in the Force.com IDE and click Execute.

  • Use the SOAP API to make a call to execute anonymous code.

  • Create and execute a test method that does not specify a ruzias () call.

Explanation

Question 41 of 73

1

What are two characteristics of partial copy sandboxes versus full sandboxes? Choose 2 answers

Select one or more of the following:

  • includes a subset of metadata

  • requires a sandbox template

  • supports more frequent refreshes

  • provides more data record storage

Explanation

Question 42 of 73

1

Which two statements are true about Apex code executed in Anonymous Blocks? Choose 2 answers

Select one or more of the following:

  • The code runs with the permissions of the logged in user.

  • The code runs with the permissions of the user specified in the runAs () statement.

  • The code runs in system mode having access to all objects and fields.

  • Successful DML operations are automatically committed.

  • All DML operations are automatically rolled back.

Explanation

Question 43 of 73

1

An after trigger on the Account object performs a DML update operation on all of the child Opportunities of an Account. There are no active triggers on the Opportunity object, yet a "maximum trigger depth exceeded" error occurs in certain situations.
Which two reasons possibly explain the Account trigger firing recursively? Choose 2 answers

Select one or more of the following:

  • Changes are being made to the Account during Criteria Based Sharing evaluation.

  • Changes are being made to the Account during an unrelated parallel save operation.

  • Changes to Opportunities are causing cross-object workflow field updates to be made on the Account.

  • Changes to Opportunities are causing roll-up summary fields to update on the Account.

Explanation

Question 44 of 73

1

Which control statement should a developer use to ensure that a loop body executes at least once?

Select one or more of the following:

  • for (variable : list_or_set) {... }

  • while (condition) {...}

  • for (init_stmt; exit_condition; increment_stmt) { ...}

  • do {... } while (condition)

Explanation

Question 45 of 73

1

A developer wrote the following after insert trigger to create a follow-up Task whenever a new Task is created.
List<Task> followupTasks = new List<Task>();
for ( Task theTask : Trigger.new ){
Task newTask = new Task(Status = 'New', Priority = 'Normal');
newTask.Subject = 'Follow-up for ' + theTask.Subject;
newTask.ActivityDate = Date.today().adddays(30);
followupTasks.add( newTask );
}
insert followupTasks;
What happens after the code block executes?

Select one or more of the following:

  • The trigger fails if the Task Subject is blank.

  • A new Task is created for each Task in Trigger.new.

  • The trigger enters an infinite loop and eventually fails.

  • Multiple Tasks are created for each Task in Trigger.new.

Explanation

Question 46 of 73

1

A developer needs to import customer subscription records into Salesforce and attach them to existing Account records.
Which two actions should the developer take to ensure the subscription records are related to the correct Account records? Choose 2 answers

Select one or more of the following:

  • Match an External Id Text field to a column in the imported file.

  • Match an Auto-Number field to a column in the imported file.

  • Match the Name field to a column in the imported file.

  • Match the Id field to a column in the imported file.

Explanation

Question 47 of 73

1

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

Select one or more of the following:

  • Use a custom controller.

  • Use a custom controller with extensions.

  • Use a standard controller with extensions.

  • Do not specify a controller.

  • Use a standard controller.

Explanation

Question 48 of 73

1

A developer needs to apply the look and feel of Lightning Experience to a number of applications built using a custom third-party JavaScript framework and rendered in Visualforce pages.
Which option achieves this?

Select one or more of the following:

  • Set the attribute enableLightning to "true" in the definition.

  • Replace the third-party JavaScript library with native Visualforce tags.

  • Configure the User Interface options in the Setup menu to enable Legacy Mode for Visualforce.

  • Incorporate Salesforce Lightning Design System CSS stylesheets into the JavaScript applications.

Explanation

Question 49 of 73

1

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.
public void prccessAccount() ? Decimal acctScore = acct.Rating c * 100;
What is the value of acctScore after this code executes?

Select one or more of the following:

  • 5

  • 50

  • 500

  • 5000

Explanation

Question 50 of 73

1

A developer can use the debug log to see which three types of information? Choose 3 answers

Select one or more of the following:

  • Resource usage and limits

  • Database changes

  • User login events

  • HTTP callouts to external systems

  • Actions triggered by time-based workflow

Explanation

Question 51 of 73

1

Which feature allows a developer to create test records for use in test classes?

Select one or more of the following:

  • Static Resources

  • Documents

  • HttpCalloutMocks

  • WebServiceTests

Explanation

Question 52 of 73

1

Why would a developer use Test.startTest() and Test.stopTest()?

Select one or more of the following:

  • To avoid Apex code coverage requirements for the code between these lines

  • To start and stop anonymous block execution when executing anonymous Apex code.

  • To indicate test code so that it does not impact Apex line count governor limits

  • To create an additional set of governor limits during the execution of a single test class.

Explanation

Question 53 of 73

1

What is an accurate constructor for a custom controller named MyContactLastController?

Select one or more of the following:

  • public MyContactListController(ApexPages.StandardController stdController) { Account a = (Account) stdController.getRecord(); contacts = a.Contacts;
    }

  • public MyContactListController(ApexPages.StandardSetController stdSetController) f contacts = (List<Contact>) stdSetController.getRecords();
    }

  • public MyContactListController(List<sObject> records) f contacts = (List<Contact>) records;
    }

  • public MyContactListController() { contacts = new List<Contact>();
    }

Explanation

Question 54 of 73

1

Which three statements are true regarding cross-object formulas? Choose 3 answers

Select one or more of the following:

  • Cross-object formulas can reference fields from master-detail or lookup relationships.

  • Cross-object formulas can reference fields from objects that are up to 10 relationships away.

  • Cross-object formulas can expose data the user does not have access to in a record.

  • Cross-object formulas can reference child fields to perform an average.

  • Cross-object formulas can be referenced in roll-up summary fields.

Explanation

Question 55 of 73

1

Which governor limit applies to all the code in an Apex transaction?

Select one or more of the following:

  • Elapsed CPU time

  • Number of new records created

  • Number of classes called

  • Elapsed SOQL query time

Explanation

Question 56 of 73

1

Which action can a developer take to reduce the execution time of the following code?
List<Account> ailAccounts = [SELECT Id FROM Account];
List<Contact> allContacts = [SELECT Id, Accountld FROM Contact];
for (Account a : allAccounts){
for (Contact c: allContacts){ if (c.Accountid = a•Id){ // do work } } }

Select one or more of the following:

  • Use a Map <Id, Contact> for allContacts.

  • Add a GROUP BY clause to the Contact SOQL.

  • Put the Account loop inside the Contact loop.

  • Create an Apex helper class for the SOQL.

Explanation

Question 57 of 73

1

A Platform Developer needs to implement a declarative solution that will display the most recent Closed Won date for all Opportunity records associated with an Account.
Which field is required to achieve this declaratively?

Select one or more of the following:

  • Roll-up summary field on the Opportunity object

  • Cross-object formula field on the Account object

  • Roll-up summary field on the Account object

  • Cross-object formula field on the Opportunity object

Explanation

Question 58 of 73

1

A developer has lavaScript 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?

Select one or more of the following:

  • controller.js

  • superRender.js

  • renderer.js

  • helper.js

Explanation

Question 59 of 73

1

Which two automation tools include a graphical designer? Choose 2 answers

Select one or more of the following:

  • Approvals

  • Flow Builder

  • Process Builder

  • Workflows

Explanation

Question 60 of 73

1

How can a developer get all of the available record types for the current user on the Case object?

Select one or more of the following:

  • Use SOQL to get all Cases

  • Use DescribeSObjectResult of the Case object.

  • Use Case.getRecordTypes().

  • Use DescribeFieldResult of the Case.RecordType field.

Explanation

Question 61 of 73

1

A developer needs to automatically populate the Reports To field in a Contact record 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

Select one or more of the following:

  • before update

  • after insert

  • before insert

  • after update

Explanation

Question 62 of 73

1

To which data type in Apex a currency field automatically assigned?

Select one or more of the following:

  • Integer

  • Decimal

  • Double

  • Currency

Explanation

Question 63 of 73

1

Which type of code represents the Controller in MVC architecture on the Force.com platform? Choose 2 answers.

Select one or more of the following:

  • JavaScript that is used to make a menu item display itself.

  • StandardController system methods that are referenced by Visualforce.

  • Custom Apex and JavaScript code that is used to manipulate data.

  • A static resource that contains CSS and images.

Explanation

Question 64 of 73

1

Which action can a developer perform in a before update trigger? Choose 2 answers

Select one or more of the following:

  • Update the original object using an update DML operation.

  • Delete the original object using a delete DML operation.

  • Change field values using the Trigger.new context variable.

  • Display a custom error message in the application interface.

Explanation

Question 65 of 73

1

How should the developer overcome this problem? While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard Pricebook since one already exist in the org.

Select one or more of the following:

  • Use @IsTest(SeeAllData=true) and delete the existing standard Pricebook.

  • Use @TestVisible to allow the test method to see the standard Pricebook.

  • Use Test.getStandardPricebbokId()to get the standard Pricebook ID.

  • Use Test.loaddata() and a Static Resource to load a standard Pricebook

Explanation

Question 66 of 73

1

How can a developer avoid exceeding governor limits when using an Apex Trigger? Choose 2 answers.

Select one or more of the following:

  • By using a helper class that can be invoked from multiple triggers.

  • By using the Database class to handle DML transactions.

  • By using Maps to hold data from query results.

  • By performing DML transactions on lists of sObjects

Explanation

Question 67 of 73

1

A developer runs the following anonymous code block:
List<Account> acc = [select id from Account limit 10]; Delete acc;
Database.emptyRecycleBin(acc);
System.debug(Limits.getDMLStatements() + ‘, ’ + Limits.getLimitDMLStatements());
What is the result?

Select one or more of the following:

  • 11, 150

  • 150, 2

  • 150, 11

  • 2, 150

Explanation

Question 68 of 73

1

Which tool can deploy destructive changes to apex classes in production?

Select one or more of the following:

  • Workbench

  • Salesforce setup

  • Change Sets

  • Developer Console

Explanation

Question 69 of 73

1

Which type of controller should a developer use to include a list of related records for a custom object record on a visualforce page without needing additional test coverage?

Select one or more of the following:

  • Custom Controller

  • List Controller

  • Controller Extension

  • Standard Controller

Explanation

Question 70 of 73

1

A change set deployment from a sandbox to production fails due to a failure in a managed package unit test. The developer spoke with the managed package owner and they determined it is false positive and can be ignored.
What should the developer do to successfully deploy?

Select one or more of the following:

  • Edit the managed package’s unit test

  • Select “Fast Deploy” to run only the tests that are in the change set

  • Select “Run local tests” to run only the tests that are in the change set

  • Select “Run local tests” to run all tests in the org that are not in the managed package

Explanation

Question 71 of 73

1

Which two condition cause workflow rules to fire? Choose 2 answers

Select one or more of the following:

  • Changing territory assignments of accounts and opportunities

  • Updating record using bulk API

  • Converting leads to person account

  • An Apex batch process that changes field values

Explanation

Question 72 of 73

1

A developer writes the following code:

List<account> acc= [SELECT id FROM Account LIMIT 10]; Delete acc; Database.emptyRecyclebin(acc); System.Debug(Limits.getDMLStatemnets()+’,’+ Limits.getLimitDMLStatements());

Select one or more of the following:

  • 1,150

  • 2,200

  • 1,100

  • 2,150

Explanation

Question 73 of 73

1

What is true of a partial sandbox that is not true of a full sandbox?

Select one or more of the following:

  • More frequent refreshes

  • Only includes necessary meta data

  • Use of change sets

  • Limited to 5 GB of data

Explanation