Google adds

PD-1 Demo 2 Sp-18

Spring 2018 PD1 Questions:
  1. A developer created a Lightning Component named accountList.cmp that displays 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 number?
  1. accountListRenderer.js
  2. accountList.renderer
  3. accountListHelper.js ( Ans )
  4. accountList.helper

  1. What is the return data type when ApexPages.currentPage().getParameters() is used to retrieve URL parameters from a Visualforce controller?
  1. String[]
  2. List<String>
  3. Map<String, String> ( Ans )
  4. Enum

  1. What is the output of the following code?

Integer index = 1;
Integer counter = 2;
Do
{
System.debug(index);
Index++;
Counter++;
} while (index == 20 && counter == 21); 

  1. The debug statement will repeat outputs from 1 to 21.
  2. The debug statement will output 20.
  3. The debug statement will repeat outputs from 1 to 20.
  4. The debug statement will output 1. ( Ans )

  1. What area for custom Apex Exception classes?
Choose 2 answers
  1. Constructor for custom Exceptions can only accept string values as arguments.
  2. Custom Exceptions cannot be extended by other Exception classes.
  3. Custom Exception classes must extend the base Exception class. ( Ans )
  4. Custom Exception class names must end with the word ‘Exception’. ( Ans )






  1. Which collection type provides unique key/value pairings of data?
  1. Set
  2. Map ( Ans )
  3. Array
  4. List

  1. What should a developer use to post a message on chatter when a picklist field called Status__c on a custom object Application__c is set to “Approved”?
  1. Use a Workflow Rule and use the “Post to Chatter” action when the records meets the criteria.
  2. Use the streaming API to post to Chatter.
  3. Use ConnectApi from Scheduled Apex.
  4. Use Process Builder to post to Chatter based on meeting the required criteria. ( Ans )

  1. What does the context variable Trigger.old represent in an update operation?
  1. A map of IDs to the old version of the record. ( Ans )
  2. The same values of Trigger.new
  3. The current values of the records firing the trigger.
  4. The previous version values of the records firing the trigger.

  1. In which two org types can a developer create new Apex classes?
Choose 2 answers
  1. Unlimited Edition
  2. Enterprise Edition
  3. Developer Edition ( Ans )
  4. Sandbox ( Ans )

  1. Universal Containers (UC) has an integration with its Accounting system that creates tens of ------
Salesforce in a nightly batch. UC wants to add automation that can attempt to match Leads -------
Using the Email Address field on the insert. UC is concerned about the performance of the -------

Which tool should UC use to automate this process?
  1. Apex
  2. Process Builder with an Autolaunched Flow ( Ans )
  3. Workflow Rules
  4. Process Builder









  1. A developer encounters APEX heap limit errors in a trigger.
Which two methods should the developer use to avoid this error?
Choose 2 answers
  1. Remove or set collections to null after use.
  2. Use SOQL for loops instead of assigning large queries results to a single collection and looping ----- collection. ( Ans )
  3. Use the transient keyword when declaring variables. ( Ans )
  4. Query and store fields from the related object in a collection when updating related objects.

  1. A sales manager wants to make sure that whenever an opportunity stage is changed to “Closed Won, “a new case will be created for the support team to collect necessary information from the customer.
How should a developer accomplish this?
  1. Create a Process Builder to create the new case. ( Ans )
  2. Create a workflow rule to create the new case.
  3. Create a lookup field to the Case Object on the opportunity object.
  4. Set up a validation rule on the Opportunity.Stage.

  1. Which two are true regarding Apache Kafka on Heroku?
Choose 2 answers
  1. Is a distributed commit log for communication between services. ( Ans )
  2. Is an add-on that creates a long term data store.
  3. Is a messaging backbone for building distributed applications. ( Ans )
  4. Is designed to move small volumes of ephemeral data.

  1. What are three characteristics of static methods?
Choose 3 answers
  1. Initialized only when a class is loaded ( Ans )
  2. A static variable is available outside of the scope of an Apex transaction.
  3. Allowed only in outer classes. ( Ans )
  4. Allowed only in inner classes.
  5. Are NOT transmitted as part of the view state for a Visualforce page. ( Ans )

  1. A developer wants to override a button using Visualforce on an object.
What is the requirement?
  1. The action attribute must be set to a controller method.
  2. The standardController attribute must be set to the object. ( Ans )
  3. The controller or extension must have a PageReference method.
  4. The object record must be instantiated in a controller or extension.






  1. How are debug levels adjusted in the Developer Console?
  1. Under the Settings menu > Trace Settings…, click Change DebugLevel.
  2. Under the Debug menu > Change Log Levels…., click Add/Change in the DebugLevel Action column. ( Ans )
  3. Under the Logs tab, click Change in the DebugLevels panel.
  4. Under the Edit menu, click Change DebugLevels.

  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?
  1. List Controller
  2. Standard Controller ( Ans )
  3. Controller Extension
  4. Custom Controller



  1. A developer created a Visualforce page with a custom controller to show a list of accounts. The page uses the <apex:SelectList> component, with a variable called “selection”, to show the valid values for Account.Type. The page uses an <apex:pageBlockTable> component to display the list of accounts, where the iteration variable is “acct”.
The developer wants to ensure that when  a user selects a type on the <apex:selectList> component, only accounts with that type are shown on the page.
What should the developer do to accomplish this?
  1. Add the Rendered = (!Acct.type==selection) attribute to the pageBlockTable component.
  2. Create multiple lists in the controller that represent the relevant accounts for each account type when the page loads, then reference the correct one dynamically on the pageBlockTable.
  3. Create a component for each option and use a variable with hide parameter on the element.
  4. Use the onChange event  to update the list of accounts in the controller when the value changes, and then re-render the pageBlockTable. ( Ans )

  1. What are three ways for a developer to execute tests in an org?
Choose 3 answers
  1. Tooling API ( Ans )
  2. Setup Menu ( Ans )
  3. Developer Console ( Ans )
  4. Bulk API
  5. Metadata API



  1. A developer is creating 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?
  1. @isTest(SeeAllDate=true)
  2. @PreTest
  3. @TestSetup ( Ans )
  4. @BeforeTest

  1. What is the printed from the following code?

Integer a = 0;
Integer b;
a = a++;
a++;
Integer c = a*5;
String s = String.value(c) + a;
System.debug(s + ‘;’ + a +’;’ + b);

  1. 51;1;0
  2. 51;1;null ( Ans )
  3. 6;1; null
  4. 6;1;0

  1. Which SOQL query successfully returns the Accounts grouped by name?
  1. SELECT Name, Max(CreatedDate) FROM Account GROUP BY Name ( Ans )
  2. SELECT Type, Name, Max(CreatedDate) FROM Account GROUP BY Name LIMIT 5
  3. SELECT Type, Max(CreatedDate) FROM Account GROUP BY Name
  4. SELECT Id, Type, Max(CreatedDate) FROM Account GROUP BY Name

  1. A Visualforce page is written with the following controller and extensions.
<apex:page standardController=”Account” extensions=”myExtension”>
<apex:inputField value =”(!account.name)”/><p/>
<apex:commandButton value =”Save” action=”(!save)”/>
</apex:page>
The extension class myExtension has a public save() method.
Which save method or methods will be used by the Visualforce page?
  1. the save method from the standardController
  2. both – myExtension first, then the standardControllermeet 
  3. the save method from the controller extension
  4. both – the standardController first, then myExtension ( Ans )






  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?
  1. 4
  2. 10
  3. 8 ( Ans )
  4. 2

  1. Universal Containers (UC) wants to automate the Sales Operations process for Closed Won Opportunities. When an Opportunity is marked as Closed Won, UC wants to update the Account to mark it as a Customer. In addition, UC wants all of the Opportunity Line Items from a Closed Won Opportunity to be added automatically as Assets.
What is appropriate for automating this process?
  1. Workflow Rules and Process Builder
  2. Workflow Rules 
  3. Process Builder
  4. Process Builder with an Autolaunched Flow

  1. What are two benefits of using the Lightning Component Framework?
Choose 2 answers 
  1. Lightning Components render on the server, ensuring greater security and access control.
  2. The Lightning Component Framework includes libraries for integrating with popular web services.
  3. Lightning components render on the client, providing performance benefits. ( Ans )
  4. Lightning Components are built using web standards, ensuring cross-browser compatibility. ( Ans )

  1. When are code coverage calculations updated?
  1. When unit tests are run on an organization. ( Ans )
  2. When Apex code is saved.
  3. When changes are made to an organization’s configuration.
  4. When a deployment is validated.

  1. How can a custom type be identified as unique when added to a set?
  1. Methods in the class must be global.
  2. The class must have a method with the @InvocableMethod annotation.
  3. The class must implement the Equals and Hashcode methods. ( Ans )
  4. Methods in the class must be static.


  1. 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:

trigger test on Lead (before update) {
   for (Lead Id: trigger.new)
   {
      if(Id.Email != trigger.oldMap.get(Id.id).email)
      {
         Id.Prior_Email__c = trigger.oldMap.get(Id.id).email;
         Update Id;
      }
   }
}

Which type of exception will this trigger cause?
  1. A compile time exception
  2. A limit exception when doing a bulk update
  3. A null reference exception
  4. A DML exception ( Ans )

  1. 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?
  1. Extend each class from the same base class that has a method getTextSummary() that returns the summary. ( Ans )
  2. Have each class define method getTextSummary() that returns the summary.
  3. Have each class define method getObject() that returns the sObject that is controlled by the Apex class.
  4. Have each class implement an interface that defines method getTextSummary() that returns the summary.

  1. What are two uses for External IDs?
Choose 2 answers
  1. To create a record in a development environment with the same Salesforce ID as in another environment.
  2. To prevent an import from creating duplicate records using Upsert. ( Ans )
  3. To create relationships between records imported from an external system. ( Ans )
  4. To identify the sObject type in Salesforce.

  1. A developer created a helper class with a method that can be called from Visualforce pages, web services, triggers, and 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?
  1. Check if Trigger.isExecuting == true. ( Ans )
  2. Check if System.executionContext == ‘Trigger’.
  3. Check if Trigger.newMap != null.
  4. Use the executionOnTrigger annotation on the method definitaion.
  1. Universal Containers requires Service Representatives to update all Cases at least once every three days. To make sure this policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last Case update.
What should the developer use to configure the solution?
  1. Workflow rule
  2. Scheduled Apex Class
  3. Formula field ( Ans )
  4. Process Builder

  1. Which two are true regarding a Dyno?
Choose 2 answers 
  1. Is a light weight VM used to run code on the Heroku Platform.
  2. Has the ability to sleep as a standard and performance Dyno.
  3. Has Ephemeral filesystems and is rebooted every 24 hours. ( Ans )
  4. Is a lightweight linux container used in a collection to run Heroku applications. ( Ans )

  1. A developer executes the following query in Apex to retrieve a list of contacts for each account:
List<Account> accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account];
Which two exceptions may occur when it executes?
Choose 2 answers
  1. CPU limit exception due to the complexity of the query
  2. SOQL query limit exception due to the number of queries
  3. SOQL query row limit exception due to the number of contacts ( Ans )
  4. SOQL query row limit exception due to the number of accounts ( Ans )

  1. 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 subject?
  1. Use a try-catch construct to cast the sObject into one of the three sObject types.
  2. Use the getSObjectType method on each generic sObject to retrieve the sObject token. ( Ans )
  3. Use the getSObjectName method on the sObject class to get the sObject name.
  4. Use the first three characters of the sObject ID to determine the sObject type.

  1. Which two describe Heroku Redis?
Choose 2 answers
  1. Is an in-memory key-value data store, run by Heroku. ( Ans )
  2. Is provisioned and managed as an add-on. ( Ans )
  3. Is a repository for storing large images?
  4. Is an option for long term data storage?

  1. What are two testing considerations when deploying code from a sandbox to production?
Choose 2 answers
  1. Apex Code requires 100% coverage.
  2. 75% of tests must execute without failure.
  3. 100% of tests must execute without failure. ( Ans )
  4. Apex Code requires 75% coverage. ( Ans )

  1. When viewing 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?
  1. Create a Workflow Rule on the Quote Line Item object that updates a field on the parent Quote when the item is discounted.
  2. Create a roll-up summary field on the Quote Line Item Quantity field, filtered for only discounted Quote Line Items. ( Ans )
  3. Create a trigger on the Quote object that queries the Quantity field on discounted Quote Line Items.
  4. 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.

  1. Users report multiple intermittent errors and unexpected results when saving a record. Upon investigation, the finds that triggers are executing more than once.
What is a potential solution to solve this situation?
  1. Disable all triggers and use workflows.
  2. Use a private class variable to ensure that the trigger only run once.
  3. Use a static variable to check if the trigger has already run. ( Ans )
  4. Use a one trigger per object approach.

  1. A lead record that has a single related CampaignMember object is converted into a new account, contact, and Opportunity.
Which object will the CampaignMember reference using a lookup field after conversion?
  1. The Account
  2. The Opportunity
  3. The Contact ( Ans )
  4. The Product2

  1. Which three declarative fields are correctly mapped to variable types in Apex?
Choose 3 answers
  1. TextArea maps to List of type String
  2. Number maps to Integer
  3. Checkbox maps to Boolean ( Ans )
  4. Date/Time maps to Datetime ( Ans )
  5. Number maps to Decimal ( Ans )

  1. 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 test include?
  1. Asset that a null value is accepted by the method.
  2. Assert that past dates are accepted by the method.
  3. Throwing a custom exception in the unit test.
  4. Assert that future dates are rejected by the method. ( Ans )




  1. What are two ways a developer should deploy code from a developer org to an unrelated production org?
Choose 2 answers 
  1. Login to the production org and set the developer org as an inbound connection in the Deployment Settings screen.
  2. Setup a Salesforce to Salesforce connection and deploy a Change Set.
  3. Save the code to a folder on the developer’s computer, create an incoming Change Set in the production org, and upload the files directly.
  4. Package the code as an unmanaged package and install it in the production org. ( Ans )
  5. Use an IDE to upload the new code directly into the production org using the metadata API ( Ans )

  1. What are two considerations for deciding to use a roll-up summary field?
Choose 2 answers
  1. Roll-up summary fields do not cause validation rules on the parent object unless that object is edited separately.
  2. Roll-up summary can be performed on formula fields, but if their formula contains an #Error result, it may affect the summary value.
  3. Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW(). ( Ans )
  4. Roll-up cannot be performed on formula fields.

  1. What are two considerations for converting a Lookup to a Master-Detail relationship?
Choose 2 answers
  1. The organization-wide default changes to Controlled by Parent. ( Ans )
  2. The organization-wide default changes to Public Read/Write.
  3. If there are existing records with a null value in the Lookup filed, an error will occur. ( Ans )
  4. All the null values in the Lookup field will be replaced by default values.

  1. A developer has created a Visualforce Page and Apex Controller that uses the with Sharing keyword. The page will be used 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 steps should the developer take?
  1. Create one Profile, one Permission Set, and one Role.
  2. Create two Profiles, one Permission Set, and one Role.
  3. Create one Profile, two Permission Sets, and one Role.
  4. Create one Profile, one Permission Set, and two Roles. ( Ans )

  1. How should a developer prevent a recursive trigger?
  1. Use a trigger handler.
  2. Use a private Boolean variable.
  3. Use a “one trigger per object” pattern.
  4. Use a static Boolean variable. ( Ans )



  1. Which three options allow a developer to use custom styling in a Visualforce page?
Choose 3 answers
  1. A static resource  ( Ans )
  2. <apex:stylesheet> tag  ( Ans )
  3. <apex:style> tag
  4. Inline CSS ( Ans )
  5. <apex:stylesheets> tag

  1. 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 2 answers 
  1. Create an e-mail template and use it in Process Builder.
  2. Create a Visualforce page with custom styling. ( Ans )
  3. Create a visual flow that implements the company’s formatting.
  4. Install an application from the AppExchange to generate documents. ( Ans )

  1. A Visualforce page uses the Contact standard controller.
How can a developer display the Name from the parent Account record on the page?
  1. Use additional Apex logic within the controller to query for the Name field.
  2. Use SOQL syntax to find the related Accounts Name field.
  3. Use the {!contact.Account.Name} merge field syntax. ( Ans )
  4. Use an additional standard controller for Accounts.

  1. How can a developer set up a debug log on a specific user?
  1. Set up a trace flag for the user, and define a logging level and time period for the trace. ( Ans )
  2. It is not possible to setup debug logs for users other than yourself.
  3. Ask the user for access to their account credentials, log in as the user and debug the issue.
  4. Create Apex code that logs code actions into a custom object.
  1. A developer is tasked with creating a schema to track Movies, Actors, and Contracts. A single Movie can have many Contracts and a single Actor can have many Contacts Each Contract is owned and actively managed by a single user.
Which schema should be created to enable users to easily manage the Contracts they own; without requiring access to the movie or the actor records?
  1. A Master –Detail Relationship to the Movie object and a Lookup Relationship to the Actor object.
  2. A Master –Detail Relationship to the Movie object and Master-Detail Relationship to the Actor object.
  3. A Lookup Relationship to the Movie object and a Lookup Relationship to the Actor object. ( Ans )
  4. A Lookup Relationship to the Movie object and a Master-Detail Relationship to the Actor object.




  1. What is a key difference between a Master-Detail Relationship and a Lookup Relationship?
  1. When a record of a master object in a Master-Detail Relationship is deleted, the detail records are kept and not deleted.
  2. A Lookup Relationship is a required field on an object.
  3. A Master-Detail Relationship detail record inherits the sharing and security of its master record. ( Ans )
  4. When a record of a master object in a Lookup Relationship is deleted, the detail records are also deleted.

  1. 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 2 answers
  1. Use getGlobalDescribe().get(myObject).getDescribe().fields.getMap() to return a map of fields.
  2. Use myObject.sObjectType.getDescribe().fieldSet() to return a set of fileds.
  3. Use SObjectType.myObject.fields.getMap() to return a map of fields. ( Ans )
  4. Use Schema.describeSObjects(new String[]{myObject})[0].fields.getMap() to return a map of fields. ( Ans )

  1. A user selects a value from a multi-select picklist.
How is this selected value represented in Apex?
  1. As a List<String> with one element
  2. As a String ( Ans )
  3. As a Set<String> with one element
  4. As a String ending with a comma

  1. When would the use of Heroku Postgres a developer needs to display?
  1. To interconnect Microsoft SQL servers to Heroku Applications
  2. To store user generated pictures and word documents 
  3. To cache commonly accessed data for faster retrieval
  4. To store and retrieve data using the Structured Query Language ( Ans )

  1. What are two features of Heroku Connect?
Choose 2 answers 
  1. Displaying data from an external data store via External Objects
  2. Bidirectional syncs, allowing data to be written into SFDC ( Ans )
  3. Near Real Time Sync between Heroku Postgres and Salesforce ( Ans )
  4. Real Time Sync between Salesforce and Postgres

  1. A developer needs to avoid potential system problems that can arise in a multi-tenant architecture.
Which requirement helps prevent poorly written applications from being deployed to a production environment?
  1. All validation rules must be active before they can be deployed.
  2. Unit tests must cover at least 75% of the application’s Apex code. ( Ans )
  3. SOQL queries must reference sObjects with their appropriate namespace.
  4. All Apex code must be annotated with the with sharing keyword.
  1. Which tool can deploy destructive changes to Apex classes in production?
  1. Salesforce Setup
  2. Developer Console 
  3. Change Sets 
  4. Workbench ( Ans )

  1. A developer has a unit test that is failing. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous Apex tool. The code then executes without failing.
Why did the unit test fail, but not the Execute Anonymous?
  1. The test method has a syntax error in the code.
  2. The test method uses a try/catch block.
  3. The test method relies on existing data in the database. ( Ans )
  4. The test method calls an @future method.

  1. 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?
  1. SOQL Search that includes ALL ROWS
  2. SOSL search 
  3. SOSL Query that includes ALL ROWS ( Ans )
  4. SOQL Query on each object

  1. What can a developer use to determine if the core Apex code exceeds any governor limits in a test class during bulk execution?
  1. Test.getDMLStatement()
  2. @TestVisible
  3. Limits, startTest, stopTest ( Ans )
  4. @TestSetup

  1. What are two correct examples of the Model in the Salesforce MVC architecture?
Choose 2 answers
  1. Workflow rule on the Contact object
  2. Standard Lightning component
  3. Standard Account lookup on the Contact object ( Ans )
  4. Q on the custom Wizard__c object ( Ans )
  5. Custom field on the custom Wizard__c object ( Ans )
  6. Standard Account lookup on the Contact object ( Ans )
  7. Standard Lightning component
  8. Workflow rule on the Contact object







  1. A developer writes the following code:
List<Account> acc = [SELECT Id FROM Account LIMIT 10];
Delete acc;
Database.emptyRecycleBin (acc);
System. Debug (Limits.getDMLStatements () +’,  ‘+ Limits.getLimitDMLStatements () );

What is the result of the debug statement?
  1. 2,150 ( Ans )
  2. 1,150
  3. 1,100
  4. 2,200


  1.  An Org has a single account named ’NoContacts’ that has no related contacts. Given the query: List<Account> accounts = [Select ID, (Select ID, Name from contacts) from Account where Name= “NoContacts’];
  1. Accounts[0] is Null.
  2. Accounts[0] contacts is invalid Apex.
  3. Accounts[0] contacts is an empty list. ( Ans )
  4. A QueryException is thrown

  1. What are three ways for a developer to execute tests in an org? choose 3 answers
  1. Bulk API
  2. MetaData API
  3. Tooling API ( Ans )
  4. Developer console ( Ans )
  5. Setup menu  ( Ans )
  1.  Which approach should be used to provide test data for a test class?
  1. Use a test data factory class to create test data ( Ans )
  2. Query for existing records in the database
  3. Access data in @TestVisible class variables
  4. Execute anonymous code blocks that create data.

  1.  When should an apex Trigger be required instead of a process builder process?
  1. When an action needs to be taken on a delete or undelete, or before a DML operation is executed ( Ans )
  2. When a record needs to be created
  3. When a post to chatter needs to be created
  4. When multiple records related to the triggering record need to be updated

  1.  Which set of roll-up types are available when creating a roll up summary field?
  1. COUNT, SUM, MIN, MAX ( Ans )
  2. AVERAGE, COUNT, SUM, MIN, MAX
  3. AVERAGE, SUM, MIN, MAX
  4. SUM, MIN, MAX

  1. 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 results?
  1. The API name of the field is changed, and a warning is issued to update the class
  2. The API name of the field and the reference in the test class is updated
  3. The API name of the field and the reference in the test class is changed
  4. The API name is not changed and there are no other impacts. ( Ans )

  1.  Why would a developer consider using a custom controller over a controller extension?
  1. To increase the SOQL query governor’s limits
  2. To leverage built-in functionality of a standard controller
  3. To enforce user sharing settings and permissions
  4. To implement all of the logic for a page and bypass default salesforce functionality ( Ans )

  1.  Which two platform features allow for the use of unsupported languages? Choose 2 answers.
  1. App.json
  2. Docker ( Ans )
  3. Heroku ACM
  4. Buildpacks ( Ans )
  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?
  1. Create a test page that provides coverage of the custom controller
  2. Create a test class that provides coverage of the visualforce page
  3. Create a test class that provides coverage of the custom controller ( Ans )
  4. Create a test page that provides coverage of the visualforce page

  1.  A developer needs to create a visualforce page that displays case data. 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?
  1. Create one visualforce page for use by both profiles
  2. Use a new support manager permission sets
  3. Create a separate visualforce page for each profile
  4. Use a custom controller that has the with sharing keywords  ( Ans )
  1. Which three options allow a developer to use stylesheets?
  1. A static resource ( Ans )
  2. <Apex:stylesheet>tag ( Ans )
  3. <apex:stylesheets>tag
  4. Inline CSS ( Ans )
  5. <apex:style>tag

  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 allows the developer to dynamically determine the ID of the required Record Type by its name? Choose 2 answers
  1. Hardcode the ID as a constant in an Apex class
  2. Execute a SOQL query on the RecordType Object ( Ans )
  3. Use the getRecordTypeInfosByName()method in the DescribeSObjectResult Class. ( Ans )
  4. Make an outbound web service call to the SOAP API.

  1. Which approach should a developer use to add pagination to a visualforce page?
  1. The extension attribute for a page
  2. A standardController
  3. The action attribute for a page
  4. A StandardSetController ( Ans )


  1.  A Developer needs to test an invoicing system integration. After reviewing the numbers of transaction required for the test, the developer estimates that the test data will total about 2GB of data storage. Production data is not required for integration testing. Which two environments meet the requirements for testing? Choose 2 answers
  1. Full sandbox ( Ans )
  2. Developer sandbox
  3. Developer Pro Sandbox
  4. Developer Edition
  5. Partial Sandbox  ( Ans )

  1.  What is a capability of the <ltng:require> Tag that is used for loading external javascript libraries in lightning components? Choose 3 answers
  1. Loading scripts in parallel ( Ans )
  2. One-time loading from duplicate scripts ( Ans )
  3. Loading files from documents
  4. Specifying loading order ( Ans )
  5. Loading externally hosted scripts 



  1.  What is a requirement for a class to be used as a custom visualforce controller?
  1. Any top-level Apex class that has a constructor that returns a PageReference
  2. Any top-level Apex class that implements the controller interface
  3. Any top-level Apex class that has a default, no-argument constructor ( Ans )
  4. Any top-level Apex class that extends a PageReference

  1.  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 construction jobs, and track the dates and cost 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?
  1. Create a lookup field on the machinery object to the construction job object
  2. Create a junction object with Master-Detail Relationship to both the machinery object and the construction job object.
  3. Create a lookup field on the construction job object to the machinery object ( Ans )
  4. Create a Master-Detail lookup field on themachinery object tothe construction job object

  1.  Which three tools can deploy metadata to productions? Choose 3 answers.
  1. Data Loader
  2. Change set from sandbox ( Ans )
  3. Change set from developer org
  4. Force.com IDE ( Ans )
  5. Metadata API ( Ans )

  1.  How should a developer create a new custom exception class?
  1. Public class CustomException extends Exception{} ( Ans )
  2. CustomException ex = new (CustomException) Exception();
  3. (Exception) CustomException ex = new Exception();
  4. Public class CustomException implements Exception{}

  1.  Which two number expression evaluate correctly? Choose 2 answers
  1. Integer I = 3.14159;
  2. Decimal D = 3.14159; ( Ans )
  3. Long I = 3.14159;
  4. Double D =3.14159; ( Ans )

  1.  What are the eight officially supported languages on the Heroku Platform?
  1. Lisp, PHP, Node, Ruby, Scala, Haskell, Go, Erlang
  2. C#, C++, Node, Ruby, Java, PHP, Go, .Net
  3. Node, Ruby, Java, PHP, Python, . Net, C++
  4. Node, Ruby, Java, PHP, Python,Go, Scala, Clojure. ( Ans )
  1.  A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What steps should the developer take to resolve the issue and properly test the exception?
  1. Use the finally block within the unit test to populate the exception
  2. Use database methods with all or none set to False
  3. Use try/catch within the unit test to catch the exception ( Ans )
  4. Use Test.isRunningTest() within the custom Controller

  1.  A developer has the controller class below: 
Public with sharing class myFooController {
Public integer prop { get; private set;}
}
Which code block will run successfully in an execute anonymous window?
  1. myFooController m = new myFooControler ();\
System.asseert(m.prop==null); ( Ans )
  1. myFooController m = new myFooControler ();\
System.asseert(m.prop==1);
  1. myFooController m = new myFooControler ();\
System.asseert(m.prop==0);
  1. myFooController m = new myFooControler ();\
System.asseert(m.prop=!null);

  1.  What is a benefit of using an after insert trigger over using a before insert trigger?
  1. An after insert trigger allows a developer to bypass validation rules when updating fields on the new records
  2. An after insert trigger allows a developer to make a callout to an external service.
  3. An after insert trigger allows a developer to insert other objects that reference the new records ( Ans )
  4. An after insert trigger allows a developer to modify fields in the new record without a query.

  1.  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. how should the developer overcome this problem?
  1. Use @IsTest(SeeAllData=true) and delete the existing standard Pricebook.
  2. Use @TestVisible to allow the test method to see the standard Pricebook.
  3. Use Test.getStandardPricebbokId()to get the standard Pricebook ID. ( Ans )
  4. Use Test.loaddata() and a Static Resource to load a standard Pricebook.




  1.  What is the correct invocation to push code to the app sushi-prod from the command line?
  1. Heroku push - -  app sushi-prod
  2. git push master
  3. Herokugit push master
  4. git push heroku master - -  app sushi-prod ( Ans )

  1.  When an Account’s custom picklist field called Customer Sentiment is changed to a value of “Confused,” a new related Cases should automatically be created. Which two methods should a developer use to create this case? Choose two answers
  1. Process Builder ( Ans )
  2. Custom Button
  3. Apex Trigger ( Ans )
  4. Workflow Rule

  1.  A developer is asked to set a Picklist field to ‘Monitor’ on any new Leads owned by a subset of Users. How should the developer implement this request?
  1. Create a lead Workflow Rule Field Update ( Ans )
  2. Create an after insert Lead trigger
  3. Create a Lead formula field
  4. Create a before insert lead Trigger

  1.  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?
  1. Create a workflow rule on the Quote Line Item Object that updates a field on the parent Quote when the item is discounted
  2. 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. ( Ans )
  3. Create a Trigger on the Quote Object that queries the Quantity filed on discounted Quote Line Items 
  4. Create a formulat field on the Quote Object that performs a SUM on the Quote Line Item Quantity field, filtered for only discounted Quote Line Items.

  1.  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 <apex:page> attribute(s) to correctly implement controller functionality?
  1. standardController = “case” and extensions =” myControllerExtension” ( Ans )
  2. extensions=”myControllerExtension” 
  3. controller=”myControllerExtension”
  4. controller = “case” and extensions =”myControllerExtension”



  1.  Which two strategies should a developer use to avoid hitting governor limits when developing in a multi-tenant environment? Choose two answers
  1. use variables within Apex classes to store large amounts of data
  2. use collections to store all fields from a related object and not just minimally required fields
  3. use methods from the “LIMITS” class to monitor governor limits ( Ans )
  4. use SOQL for loops to iterate data retrieved from queries that return a high number of rows ( Ans )

  1.  Which statement results in an Apex compiler error? 
  1. Map<id, Lead> imap = new map <Id, Lead>([Select ID from Lead Limit 8]);
  2. List<string> s = List<string> { ‘a’,’b’,’c’}; ( Ans )
  3. Integer a=5, b=6,c,d=7;
  4. Date D1 = Date.Today(), d2 = DATE.ValueOf(‘2018-01-01’);

  1.  How should a developer avoid hitting the governor limits in test methods?
  1. Use Test.startTest() to reset governor limits ( Ans )
  2. Use @TestVisible on methods that creates records
  3. Use @IsTest (SeeAllData=true) to use existing data
  4. Use Test.loadData() to load data from a static resource.

  1.  A newly hired developer discovers that there are multiple triggers on the case object. What should the developer consider when working with triggers?
  1. Trigger execution order is not guaranteed for the same sObject ( Ans )
  2. Trigger execution order is based on creation date and time
  3. Unit test must specify the trigger being tested.
  4. Developers must dictated the order of the trigger execution 

  1. What are three characteristics of static methods? Choose 3 answers
  1. Initialized only when a class is loaded ( Ans )
  2. A static variable is available outside of the cope of an Apex transaction
  3. Allowed only in outer classes ( Ans )
  4. Allowed only in inner classes
  5. Are Not transmitted as part of the view state for a Visualforce page  ( Ans )

  1. Before putting an app into production, which step should be taken?
  1. Run the production check feature via the web interface ( Ans )
  2. Switch to a production database
  3. Insure that you have installed a performance introspection add-on
  4. Scale your dynos


  1. What are two benefits of the lightning component framework? Choose 2 answers
  1. It allows faster PDF generation with lightning components
  2. It simplifies complexity when building pages, but not applications
  3. It provides an event-driven architecture for better decoupling between components ( Ans )
  4. It promotes faster development using out-of-the-box components that are suitable for desktop and mobile devices. ( Ans )
  1. What should a developer use to implement an automatic Approval Process Submission for Cases?
  1. A workflow rule
  2. Process builder ( Ans )
  3. Scheduled Apex
  4. An Assignment rule 

  1. Which tool allows a developer to send requests to the salesforce REST APIs ad view the responses?
  1. Developer Console REST tab
  2. REST resource Path URL
  3. Workbench Rest Explorer ( Ans )
  4. Force.com IDE REST Explorer Tab

  1.  A developer working on a time management application wants to make total hours for each timecard available to application user.  A timecard entry has a Master- Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively?
  1. A roll-up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard
  2. A process builder process that updates a field on the timecard when a timecard entry is created ( Ans )
  3. An apex trigger that sues an aggregate query to calculate the hours for a given timecard and stores it in a custom field. 
  4. A visualforce page that calculates the total number of hours for a timecard and displays it on the page.

  1. Where can a developer identify the time taken by each process in request using Developer console log inspector. 
  1. Save order tab under Execution Overview panel
  2. Performance Tree tab under Stack Tree Panel
  3. Timeline tab under Execution Overview panel ( Ans )
  4. Execution tree tab under Stack Tree Panel


  1. In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?
  1. As a set<String> with each value as an element in the set
  2. As a list<String> with each value as an element in the list
  3. As a string with each value separated by a semi colon ( Ans )
  4. As a string with each value separated by a semi comma 

  1.  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?
  1. Build an OpportunityLineItem trigger that adds a PriceBookEntry Record
  2. Build an Opportunity trigger that to add OpportunityLineItem Record
  3. Build an Opportunity trigger that addsPriceBookEntry Record
  4. Build an OpportunityLineItem trigger to add OpportunityLineItem Record ( Ans )

  1.  What are two uses of External IDS? Choose 2 answers
  1. To prevent an import from creating duplicate records using Upsert ( Ans )
  2. To identify the sObject type in Salesforce
  3. To create a record in a development environment with the same salesforce ID as in another environment 
  4. To create relationships between records imported from an external system. ( Ans )

  1.  What are two valid options for iterating through each Account in the collection List <Account> named AccountList? Choose 2 answers. 
  1. for (Integer i=0; i<AccountList. Size();i++){…} ( Ans )
  2. for (List L : AccountList) {…}
  3. for(AccountList){…}
  4. for (Account theAccount : AccountList){…} ( Ans )

  1. Which three options can be accomplished with formula fields?
  1. Generate a link using the HIPERLINK function to a specific record in a legacy system ( Ans )
  2. Determine if a datetime field has passed using the NOW function ( Ans )
  3. Determine which of three different images to display using IF function ( Ans )
  4.  Return and display a field value from another object using the VLOOKUP function
  5. Display the previous value for a field using the PRIORVALUE function

  1.  Which two platform features align to the controller portion of MVC architecture
  1. Standard Objects
  2. Workflow Rules ( Ans )
  3. Apex Rules ( Ans )
  4. Field updates

  1. A Developer wants to override a button using visualforce on an object. What is the requirement? 
  1. The object record must be instantiated in a controller or extension
  2. The standardController attribute must be set to the object ( Ans )
  3. The controller or extension must have a PagerReference Method
  4. The Action attribute must be set to a controller method

  1. Which two Apex data types can be used to reference a Salesforce record ID Dynamically? Choose two answers
  1. ENUM ( Ans )
  2. External ID
  3. sObject
  4. ( Ans )

  1.  A developer tasked with creating a schema to track Movies, Actors, and contracts. A single movie can have many contracts and a single actor can have many contracts. Each contract is owned and actively managed by a single user. Which schema should be created to enable user to easily manage the contract they own; without requiring access to the movie or the actor records?
  1. A master detail relationship to the movie object and a lookup relationship to the actor object
  2. A lookup relationship to the movie object and a lookup relationship to the actor object ( Ans )
  3. A lookup relationship to the movie object and a master detail relationship to the actor object
  4. A master detail relationship to the movie object and a master detail relationship to the actor object

  1.  When would the use of Heroku Postgres be appropriate?
  1. To interconnect Microsoft SQL Servers to Heroku Applications
  2. To store and retrieve data using the Structured Query Language ( Ans )
  3. To store user generated pictures and word documents
  4. To cache commonly accessed data for faster retrieval ( Ans )

  1.  What are two considerations for converting a lookup to a Master-detail relationship? Choose 2 answers
  1. All the null values in the lookup field will be replaced by default values.
  2. The organization wide default changes to controlled by parent ( Ans )
  3. If there are existing records with a null value in the lookup field, an error will occur. ( Ans )
  4. The organisation wide defaults changes to pubic read/write 

  1.  What should a developer use to post a message on chatter when a picklist field called Status_c on a custom object Application_c is set to “Approved”?
  1. Use a workflow rule and use the “Post to Chatter” Action when the record meets the criteria.
  2. Use connectAPI from Scheduled Apex.
  3. Use the streaming API to post to chatter
  4. Use Process Builder to post to chatter based on meeting the required criteria. ( Ans )
Heroku Dynos - lightweight, isolated environments that provide compute, memory, an OS, and an ephemeralfilesystem, Dynos are isolated, virtualized Linux containers that are designed to execute code based on a user-specified comman
Heroku Redis- key-value data store, Heroku Redis lets you gain greater visibility into performance, better manage your instances with a powerful CLI and easily federate data with
Apache Kafka is a distributed commit logfor fast, fault-tolerant communication between producers and consumers using message based topics. Kafka provides the messaging backbone for building a new generation of distributed applications capable of handling billions of events and millions of transactions.
Heroku Connect -Using bi-directional synchronization between Salesforce and Heroku Postgres,

  1. A developer is asked to write negative test as part of the unit testing for a method that calculates a person’s age based on birth date. What should the negative test includes?
  1. Assert that a null value is accepted by the method
  2. Assert that future dates are rejected by the method ( Ans )
  3. Throwing a custom exception in the unit test.
  4. Assert that past dates are accepted by the method. 

  1. A developer needs to avoid potential system problems that can arise in a multi-tenant architecture. Which requirement helps prevent poorly written applications from being deployed to a production environment?
  1. All validation rules must be active before they can be deployed
  2. SOQL queries must reference sObjects with their appropriate namespace
  3. All Apex Code must be annotated with the with sharing keyword
  4. Unit tests must cover at least 75% of the application’s Apex code. ( Ans )

  1. Which tool can deploy destructive changes to apex classes in production?
  1. Workbench ( Ans )
  2. Salesforce setup
  3. Change Sets
  4. Developer Console




  1.  A visualforce page is written with the following controller and extensions:
<apex.page standardController=”Account” extensions =”myExtension”>
<apex:inputField vaue=”(!Account.name)”/><p/>
<Apex:commandButton value=”Save” action=”(!save)”/>
</apex:page>
The extension class myExtension has a public save()method.
Which save method or methods will be used by the visualforce page?
  1. The save method from the controller extension
  2. Both – the standardController first, then myExtension ( Ans )
  3. Both – the myExtension first, the standardController
  4. The save method from the standardController

  1.  A user selects a value from a multi-select picklist. How is this selected value represented in Apex?
  1. As a string ending with a comma
  2. As a string ( Ans )
  3. As a list<String> with one element
  4. As a set<string> with one element

  1.  What are two considerations for deciding to use a roll up summary field?
  1. Roll-up summary fields do not cause validation rules on the parent object unless that object is edited separately
  2. Roll-up cannot be performed on formula fields
  3. Roll-up cannot be performed on formula fields that use cross-object reference or on-the-fly-calculation such as Now().( Ans )
  4. Roll up summary can be performed on formulate fields but if their formulate contains an #error results, it may affect the summary. ( Ans )

  1.  Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers
  1. String qryName = ‘%’ + String.enforceSecurityChecks(name)+ ‘%’;
    String qryString = ‘SELECT Id FROM Contact WHERE Name LIKE :qryNAme’;
    List<Contact> queryResults = Database.query(qryString); ( Ans )
  2. String qryName = ‘%’ + name‘%’;
    String qryString = ‘SELECT Id FROM Contact WHERE Name LIKE :qryNAme’;
    List<Contact> queryResults = Database.query(qryString);
  3. String qryName = ‘%’ + String.escpaeSingleQuotes(name)+ ‘%’;
    String qryString = ‘SELECT Id FROM Contact WHERE Name LIKE :qryNAme’;
    List<Contact> queryResults = Database.query(qryString); ( Ans )
  4. String qryString = ‘SELECT Id FROM Contact WHERE Name LIKE :qryNAme’;
    List<Contact> queryResults = Database.query(qryString);

  1.  A sales manager wants to make sure that whenever an opportunity stage is changed to “Closed Won,” a new case will be created for the support team to collect necessary information from the customers. How should a developer accomplish this?
  1. Create a process builder to create the new cases. ( Ans )
  2. Set up a validation rule on the opportunity stage
  3. Create a lookup field to the case object on the opportunity object.
  4. Create a workflow rule.

  1.  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?
  1. SOQL Query that includes ALL ROWS
  2. SOQL query on each object
  3. SOSL Query that includes ALL ROWS ( Ans )
  4. SOSL query on each object

  1. Which two are two regarding Apache Kafka on Heroku? Choose 2 answers
  1. Is a messaging backbone for building distributed applications ( Ans )
  2. Is an add-on that creates a long term data store
  3. Is a distributed commit log for communication between services ( Ans )
  4. Is designed to move small volume of ephemeral data 

  1. What does the context variable Trigger.old represent in an update operation?
  1. The same values of Trigger.new
  2. The current values of the records firing the trigger
  3. The previous version values of the records firing the trigger ( Ans )
  4. A map of IDs to the Old version of the records 

  1.  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?
  1. Throwing a custom exception in the unit test. 
  2. Assert that a null is accepted by the method.
  3. Assert that past dates are accepted by the method.
  4. Assert that future dates are rejected by the method.  (ANS)


  1.  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?
  1. Have each class implement an interface that defines method getTextSummary() that returns the summary
  2. Have each class define method getTextSummary() that returns the summary.
  3. Have each class define method getObject() that returns the sObject that returns the sObject that Is controlled by the Apex class.
  4. Extend each class from the same base class that has a method getSummary() that returns the summary. ( Ans )

  1. UC wants to automate the sales operations process for closed won oppo. When an opp is marked as closed won, UC wants to update the account to mark it as customer. In addition, UC wants all of the opp line items from closed won opp to be automatically added to assets.
  1. Workflow rules
  2. Process builder
  3. Workflow rules and process builder
  4. Process builder with an auto launched flow  ( Ans )

  1.  What is the key diff between master-detail and lookup relationship?
  1. When a record of master object in a look up relationship is deleted, the detail records are also deleted.
  2. When a record of master object in a look up relationship is deleted , the detail records are not deleted 
  3. Lookup fields are required field on an object
  4. A master detail relationship detail record inherits the sharing and security of its master record. ( Ans )

  1.  Three char of static methods?
Choose 3 
  1. Initialized only when a class is loaded ( Ans ) 
  2. A static variable is available outside the scope of the apex transaction
  3. Allowed only in outer classes ( Ans )
  4. Allowed only in inner classes
  5. Excluded from the view state of a VF page ( Ans )

  1.  A developer wants to override a button using VF on an object 
What is the requirement?
  1. The object record must be instantiated in a controller or extension
  2. The standard controller attribute must be set to the object ( Ans )
  3. The action attribute must be set to a controller method 
  4. The Controller or extension must have a page reference method.

  1.  A visual Force page uses contact standard controller 
How can a developer display the name from the parent account record on the page?

  1. Use { !contact.Account.name} merge field syntax ( Ans )
  2. Use SOQL syntax to find the related accounts Name field.
  3. Use additional apex logic within the controller to query for the name field
  4. Use an additional standard controller for Accounts. 

  1. Universal containers require service representative to update all cases at least once every three days. To make sure the policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last case update.
What should developer configure?

  1. Workflow rule  
  2. Formula field ( Ans )
  3. Process builder 
  4. Scheduled apex class 

No comments:

Post a Comment

All Governor Limit

Number of SOQL queries: 100 Number of query rows: 50,000 Number of SOSL queries: 20 Number of DML statements: 150 Number of DML rows: 10,...