PD1 Flashcards
(95 cards)
An Org has a single account named ’NoContacts’ that has no related contacts. Given the query: List accounts = [Select ID, (Select ID, Name from contacts) from Account where Name= “NoContacts’];
a) Accounts[0] is Null.
b) Accounts[0] contacts is invalid Apex.
c) accounts[0] contacts is an empty list.
d) A QueryException is thrown
a) Accounts[0] is Null
What are three ways for a developer to execute tests in an org? choose 3 answers
a) Bulk API
b) MetaData API
c) Tooling API
d) Developer console
e) Setup menu
a) Bulk API
b) MetaData API
d) Developer console
Which approach should be used to provide test data for a test class?
a) Use a test data factory class to create test data
b) Query for existing records in the database
c) Access data in @TestVisible class variables
d) Execute anonymous code blocks that create data.
a) Use a test data factory class to create test data
When should an apex Trigger be required instead of a process builder process?
a) When an action needs to be taken on a delete or undelete, or before a DML operation is executed
b) When a record needs to be created
c) When a post to chatter needs to be created
d) When multiple records related to the triggering record need to be updated
a) When an action needs to be taken on a delete or undelete, or before a DML operation is executed
Which set of roll-up types are available when creating a roll up summary field?
a) COUNT, SUM, MIN, MAX
b) AVERAGE, COUNT, SUM, MIN, MAX
c) AVERAGE, SUM, MIN, MAX
d) SUM, MIN, MAX
a) COUNT, SUM, MIN, MAX
Which three declarative fields are correctly mapped to variable types in Apex? Choose 3 answers
a) Number maps to integer
b) Textarea maps to list of type String
c) Checkbox maps to Boolean
d) Date/Time maps to Datetime
e) Number maps to Decimal
a) Number maps to integer
c) Checkbox maps to Boolean
d) Date/Time maps to Datetime
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?
a) The API name of the field is changed, and a warning is issued to update the class
b) The API name of the field and the reference in the test class is updated
c) The API name of the field and the reference in the test class is changed
d) The API name is not changed and there are no other impacts.
a) The API name of the field is changed, and a warning is issued to update the class
Why would a developer consider using a custom controller over a controller extension?
a) To increase the SOQL query governor’s limits
b) To leverage built-in functionality of a standard controller
c) To enforce user sharing settings and permissions
d) To implement all of the logic for a page and bypass default salesforce functionality
d) To implement all of the logic for a page and bypass default salesforce functionality
Which two platform features allow for the use of unsupported languages? Choose 2 answers.
a) App.json
b) Docker
c) Heroku ACM
d) Buildpacks
b) Docker
c) Heroku ACM
. A developer writes the following code:
List acc= [SELECT id FROM Account LIMIT 10];
Delete acc;
Database.emptyRecyclebin(acc);
System.Debug(Limits.getDMLStatemnets()+’,’+ Limits.getLimitDMLStatements());
What is the result of the debug statement?
a) 1,150
b) 2,200
c) 1,100
d) 2,150
d) 2,150
A developer created a visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page. What should the developer do to deploy to production?
a) Create a test page that provides coverage of the custom controller
b) Create a test class that provides coverage of the visualforce page
c) Create a test class that provides coverage of the custom controller
d) Create a test page that provides coverage of the visualforce page
c) Create a test class that provides coverage of the custom controller
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?
a) Create one visualforce page for use by both profiles
b) Use a new support manager permission sets
c) Create a separate visualforce page for each profile
d) Use a custom controller that has the with sharing keywords
d) Use a custom controller that has the with sharing keywords
A developer executes the following query in Apex to retrieve a list of contacts for each account:
List accounts = [ Select ID, Name, (Select ID, Name from Contacts) from Account];
Which two exceptions may occur when it executes? Choose 2 answers
a) SOQL query limit exception due to the number of queries
b) CPU limit exception due to the complexity of the query
c) SOQL query limit exception due to the number of contacts
d) SOQL query limit exception due to the number of accounts
c) SOQL query limit exception due to the number of contacts
d) SOQL query limit exception due to the number of accounts
Which three options allow a developer to use stylesheets?
a) A static resource
b) tag
c) tag
d) Inline CSS
e) tag
a) A static resource
b) tag
e) tag
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
a) Hardcode the ID as a constant in an Apex class
b) Execute a SOQL query on the RecordType Object
c) Use the getRecordTypeInfosByName()method in the DescribeSObjectResult Class.
d) Make an outbound web service call to the SOAP API.
b) Execute a SOQL query on the RecordType Object
c) Use the getRecordTypeInfosByName()method in the DescribeSObjectResult Class.
Which SOQL query successfully returns the Accounts grouped by name?
a) Select type, Max(CreatedDate) FROM Account GROUP BY Name
b) Select Name, Max(CreatedDate) FROM Account GROUP BY Name
c) Select Id, type, Max(CreatedDate) FROM Account GROUP BY Name
d) Select type, Name Max(CreatedDate) FROM Account GROUP BY Name LIMIT 5
b) Select Name, Max(CreatedDate) FROM Account GROUP BY Name
Which approach should a developer use to add pagination to a visualforce page?
a) The extension attribute for a page
b) A standardController
c) The action attribute for a page
d) A StandardSetController
d) A StandardSetController
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
a) Full sandbox
b) Developer sandbox
c) Developer Pro Sandbox
d) Developer Edition
e) Partial Sandbox
a) Full sandbox
e) Partial Sandbox
How should a developer prevent a recursive trigger?
a) Use a private Boolean variable
b) Use a “one trigger per object” pattern.
c) Use a trigger handler
d) Use a static Boolean variable
d) Use a static Boolean variable
What is a capability of the Tag that is used for loading external javascript libraries in lightning components? Choose 3 answers
a) Loading scripts in parallel
b) One-time loading from duplicate scripts
c) Loading files from documents
d) Specifying loading order
e) Loading externally hosted scripts
a) Loading scripts in parallel
b) One-time loading from duplicate scripts
d) Specifying loading order
What is a requirement for a class to be used as a custom visualforce controller?
a) Any top-level Apex class that has a constructor that returns a PageReference
b) Any top-level Apex class that implements the controller interface
c) Any top-level Apex class that has a default, no-argument constructor
d) Any top-level Apex class that extends a PageReference
d) Any top-level Apex class that extends a PageReference
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?
a) Create a lookup field on the machinery object to the construction job object
b) Create a junction object with Master-Detail Relationship to both the machinery object and the construction job object.
c) Create a lookup field on the construction job object to the machinery object
d) Create a Master-Detail lookup field on the machinery object to the construction job object
c) Create a lookup field on the construction job object to the machinery object
Which three tools can deploy metadata to productions? Choose 3 answers.
a) Data Loader
b) Change set from sandbox
c) Change set from developer org
d) Force.com IDE
e) Metadata API
b) Change set from sandbox
d) Force.com IDE
e) Metadata API
How should a developer create a new custom exception class?
a) Public class CustomException extends Exception{}
b) CustomException ex = new (CustomException) Exception();
c) (Exception) CustomException ex = new Exception();
d) Public class CustomException implements Exception{}
a) Public class CustomException extends Exception{}