Platform Dev 1 Flashcards
What is a correct pattern to follow when programming in Apex on a multitenant platform?
A. Use the with sharing keyword when declaring an Apex class to prevent access from other server tenants.
B. Use queries to select the fewest fields and records possible to avoid exceeding governor limits.
C. Create Apex code in a separate environment from the schema to reduce deployment errors.
D. Run Data Manipulation Language (DML) on one record at a time to avoid possible data concurrency issues.
B. Use queries to select the fewest fields and records possible to avoid exceeding governor limits.
Which two types of code represent the controller in model-view-controller (MVC) architecture on the Lightning Platform?
A. StandardController system methods that are referenced by Visualforce
B. JavaScript that is used to make a menu item display itself
C. A static resource that contains Cascading Style Sheets (CSS) and images
D. Custom Apex and JavaScript code that is used to manipulate data
A. StandardController system methods that are referenced by Visualforce
D. Custom Apex and JavaScript code that is used to manipulate data
When an account record changes, what should a developer do to update a picklist field on a related opportunity?
A. Create a workflow rule with a field update.
B. Create a Visualforce page.
C. Create a lightning component.
D. Create a record-triggered flow.
D. Create a record-triggered flow.
A developer is creating an application to track engines and their parts. An individual part can be used in different types of engines. Which data model should the developer use to track the data and to prevent orphan records?
A. Create a master-detail relationship to represent the one-to-many model of engines to parts.
B. Create a lookup relationship to represent how each part relates to the parent engine object.
C. Create a junction object using two lookup relationships to relate many engines to many parts.
D. Create a junction object using two master-detail relationships to relate many engines to many parts
D. Create a junction object using two master-detail relationships to relate many engines to many parts
A company wants a recruiting app and data model for job candidates and interviews, with the following requirements.
* Display the total number of interviews on each candidate record.
* Define security on interview records that’s independent from the security on candidate records.
Which two actions should a developer take to achieve this?
A. Create a lookup relationship between the Candidate and Interview objects.
B. Create a master-detail relationship between the Candidate and Interview objects.
C. Create a roll-up summary field on the Candidate object that counts interview records.
D. Create a trigger on the Interview object that updates a field on the Candidate object.
A. Create a lookup relationship between the Candidate and Interview objects.
D. Create a trigger on the Interview object that updates a field on the Candidate object.
The sales management team requires that users populate the Lead Source field of the lead record when they convert a lead. What should a developer create to ensure that users do this?
A. Flow Trigger
B. Validation Rule
C. Formula Field
D. Apex Trigger
B. Validation Rule
The sales management team hires a new intern. The intern is not allowed to view opportunities, but needs to see the most recent closed date of all child opportunities when viewing an account record. What should a developer do to meet this requirement?
A. Write a Flow on the Opportunity object that updates a field on the parent account.
B. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field.
C. Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field.
D. Create a trigger on the Account object that queries the close date of the most recent opportunities.
B. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field.
It is NOT the answer C because:
Using formula fields can result in a value returning, #Error!, which can affect the summarized total. If #Error! is included in the results, the calculations for MAX will exclude those formula values.
A developer has this trigger that fires after insert and creates a child case whenever a new case is created. Which unexpected behavior happens after the code block executes?
List<Case> childCases = new List<Case>(); for (Case parent : Trigger.new ){ Case child = new Case(ParentId = parent.Id, Subject = parent.Subject); childCases.add( child ); } insert childCases;
A. A child case is created for each parent case in Trigger.new.
B. The trigger enters an infinite loop and eventually fails
C. Multiple child cases are crated for each parent case in Trigger.New
D. The trigger failes if the Subject field on the parent is blank
B. The trigger enters an infinite loop and eventually fails
The code sample shows a recursive trigger, caused by the trigger being fired each time a new case is created inside the for loop. This creates an infinite loop and eventually causes the code to fail.
A developer wants to create a custom object to track customer invoices. How should you relate invoices and accounts to ensure that all invoices are visible to everyone with access to an account?
A. The Account should have a lookup to the relation to the Invoice
B. The Invoice should have a lookup relation to the Account
C. The Account should have a master-detail relationship to the Invoice
D. The Invoice should have a master-detail relationship to the Account
D. The Invoice should have a master-detail relationship to the Account
A custom field on the Account object was required for prototyping but is no longer needed. What is the correct process for a developer to delete the custom field?
A. Delete the field and then all references in the code will be removed
B. Remove all references in the code and then the field will be automatically removed
C. Mark the field for deletion in the Schema Builder and then delete it from the user interface
D. Remove all references to the custom field and then delete the custom field.
D. Remove all references to the custom field and then delete the custom field.
When loading data into an organization, which two actions should a developer take to match the updates to existing records?
A. Match an auto-generated Number field to a column in the imported file.
B. Match the ID field to a column in the imported file.
C. Match an External ID field to a column in the imported file.
D. Match the Name field to a column in the imported file.
B. Match the ID field to a column in the imported file.
C. Match an External ID field to a column in the imported file.
An important consideration when developing in a multi-tenant environment
Governor Limits
Which three declarative methods help ensure quality data?
Validation Rules, Lookup filters, Workflow Alerts, Page Layouts, or Exception Handling
Validation Rules
Lookup filters
Page Layouts
To which primitive data type in Apex is a currency field automatically assigned?
Decimal
Which data structure is returned to a developer when performing a SOSL search?
A List of Lists of SObjects
A developer runs this anonymous code block:
~~~
List<Account> acc = [SELECT Id FROM Account LIMIT 10];
Delete acc;
Database.emptyRecycleBin(acc);
System.debug(Limits.getDMLStatements());
System.debug(Limits.getLimitDMLStatements());
~~~</Account>
What is displayed after this code executes?
2
150