Podcast
Questions and Answers
What is the purpose of the variable qryName in the code example?
What is the purpose of the variable qryName in the code example?
To create a query string that includes the name with wildcards for partial matching.
What is a key difference between Master-Detail Relationship and a Lookup Relationship? (Select all that apply)
What is a key difference between Master-Detail Relationship and a Lookup Relationship? (Select all that apply)
In the code below, which type does String inherit from? String s = 'Hello World';
In the code below, which type does String inherit from? String s = 'Hello World';
How many total records will be committed to the database in an Apex transaction that inserts 100 Account records and 2,000 Contact records before a DML exception occurs?
How many total records will be committed to the database in an Apex transaction that inserts 100 Account records and 2,000 Contact records before a DML exception occurs?
Signup and view all the answers
Which two practices should be used for processing records in a trigger? (Select all that apply)
Which two practices should be used for processing records in a trigger? (Select all that apply)
Signup and view all the answers
Which two are required in a controller extension to override the Save standard action for a standard controller? (Select all that apply)
Which two are required in a controller extension to override the Save standard action for a standard controller? (Select all that apply)
Signup and view all the answers
How can a developer use a Set to limit the number of records returned by a SOQL query?
How can a developer use a Set to limit the number of records returned by a SOQL query?
Signup and view all the answers
When a Task is created for a Contact, how can a developer prevent the task from being included on the Activity Timeline of the Contact's Account record?
When a Task is created for a Contact, how can a developer prevent the task from being included on the Activity Timeline of the Contact's Account record?
Signup and view all the answers
From which system monitoring feature can a developer see information about @future methods that were invoked?
From which system monitoring feature can a developer see information about @future methods that were invoked?
Signup and view all the answers
What is a benefit of using a trigger framework?
What is a benefit of using a trigger framework?
Signup and view all the answers
Managed Packages can be created in which type of org?
Managed Packages can be created in which type of org?
Signup and view all the answers
How can a developer warn users of SOQL governor limit violations in a trigger?
How can a developer warn users of SOQL governor limit violations in a trigger?
Signup and view all the answers
Which line of code is causing an 'after update' trigger on the Account object to fail?
Which line of code is causing an 'after update' trigger on the Account object to fail?
Signup and view all the answers
Which two roll-up summary field types are required to find the average of values on detail records in a Master-Detail relationship? (Select all that apply)
Which two roll-up summary field types are required to find the average of values on detail records in a Master-Detail relationship? (Select all that apply)
Signup and view all the answers
What data model provides the simplest solution to allow people to be related to their employer?
What data model provides the simplest solution to allow people to be related to their employer?
Signup and view all the answers
In which two ways can a developer provide a way to mass edit, update, and delete records from a list view? (Select all that apply)
In which two ways can a developer provide a way to mass edit, update, and delete records from a list view? (Select all that apply)
Signup and view all the answers
Given the code 'Opportunity opp = [SELECT Id, Stagename FROM Opportunity LIMIT 1];', how can a developer get the label for the Stagename field?
Given the code 'Opportunity opp = [SELECT Id, Stagename FROM Opportunity LIMIT 1];', how can a developer get the label for the Stagename field?
Signup and view all the answers
The onclick attribute for a lightning:button component references a JavaScript function in which resource in the component bundle?
The onclick attribute for a lightning:button component references a JavaScript function in which resource in the component bundle?
Signup and view all the answers
Which statement is true about developing in a multi-tenant environment?
Which statement is true about developing in a multi-tenant environment?
Signup and view all the answers
Which two components are available to deploy using the Metadata API? (Choose 2 answers)
Which two components are available to deploy using the Metadata API? (Choose 2 answers)
Signup and view all the answers
In the provided class and trigger code, which code segment should be inserted to set the baseCost variable to the value of the class variable smokerCharge?
In the provided class and trigger code, which code segment should be inserted to set the baseCost variable to the value of the class variable smokerCharge?
Signup and view all the answers
What should a developer do to successfully deploy if a change set deployment from a sandbox to production fails due to a failure in a managed package unit test?
What should a developer do to successfully deploy if a change set deployment from a sandbox to production fails due to a failure in a managed package unit test?
Signup and view all the answers
Which three attributes need to be defined in the apex:commandButton tag for a custom Visualforce button on the Opportunity object page layout?
Which three attributes need to be defined in the apex:commandButton tag for a custom Visualforce button on the Opportunity object page layout?
Signup and view all the answers
Which two statements can a developer use to throw a custom exception of type MissingFieldValueException?
Which two statements can a developer use to throw a custom exception of type MissingFieldValueException?
Signup and view all the answers
What must be done in the second test method to use an Account if the first test method deletes the Account record?
What must be done in the second test method to use an Account if the first test method deletes the Account record?
Signup and view all the answers
What should a developer do to deploy to production after creating a Visualforce page and a custom controller?
What should a developer do to deploy to production after creating a Visualforce page and a custom controller?
Signup and view all the answers
Which invocation of a method in the declared class will obey the organization-wide defaults and sharing settings?
Which invocation of a method in the declared class will obey the organization-wide defaults and sharing settings?
Signup and view all the answers
How many levels of child records can be returned in a single SOQL query from one parent object?
How many levels of child records can be returned in a single SOQL query from one parent object?
Signup and view all the answers
Which three are valid assignments for a custom formula field Level__c defined as a Formula (Number) with two decimal places?
Which three are valid assignments for a custom formula field Level__c defined as a Formula (Number) with two decimal places?
Signup and view all the answers
Which two options allow a developer to dynamically determine the ID of the required Record Type by its name?
Which two options allow a developer to dynamically determine the ID of the required Record Type by its name?
Signup and view all the answers
Which two statements are true regarding formula fields?
Which two statements are true regarding formula fields?
Signup and view all the answers
What is the result if the Case update exceeds the governor limit for maximum number of DML records?
What is the result if the Case update exceeds the governor limit for maximum number of DML records?
Signup and view all the answers
Which option should a developer use to create 500 Accounts and ensure that duplicates are not created for existing Account Sites?
Which option should a developer use to create 500 Accounts and ensure that duplicates are not created for existing Account Sites?
Signup and view all the answers
Which attribute must the developer include in the apex:page tag to ensure the Visualforce page can be embedded in a page layout?
Which attribute must the developer include in the apex:page tag to ensure the Visualforce page can be embedded in a page layout?
Signup and view all the answers
Which two SOSL searches will return records matching search criteria contained in any of the searchable text fields on an object?
Which two SOSL searches will return records matching search criteria contained in any of the searchable text fields on an object?
Signup and view all the answers
What are two benefits of the Lightning Component framework?
What are two benefits of the Lightning Component framework?
Signup and view all the answers
Which two actions should a developer take to create an employee rating program allowing employees to rate each other?
Which two actions should a developer take to create an employee rating program allowing employees to rate each other?
Signup and view all the answers
Which field type should a developer choose to store a description of a product that can be entered on separate lines?
Which field type should a developer choose to store a description of a product that can be entered on separate lines?
Signup and view all the answers
Which two actions should a developer perform to get available picklist values and record types for the Opportunity object?
Which two actions should a developer perform to get available picklist values and record types for the Opportunity object?
Signup and view all the answers
What can the user expect to see when accessing the custom page created by the specified controller?
What can the user expect to see when accessing the custom page created by the specified controller?
Signup and view all the answers
For which example task should a developer use a trigger rather than a workflow rule?
For which example task should a developer use a trigger rather than a workflow rule?
Signup and view all the answers
Which is a valid Apex assignment?
Which is a valid Apex assignment?
Signup and view all the answers
Which type of code represents the Model in the MVC architecture on the Force.com platform?
Which type of code represents the Model in the MVC architecture on the Force.com platform?
Signup and view all the answers
Which declarative process automation feature supports iterating over multiple records?
Which declarative process automation feature supports iterating over multiple records?
Signup and view all the answers
Which approach should a developer use to make total hours for each timecard available to application users?
Which approach should a developer use to make total hours for each timecard available to application users?
Signup and view all the answers
Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities?
Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities?
Signup and view all the answers
Study Notes
Mass Record Editing
- Mass editing, updating, and deleting in list views can be achieved by using:
- Unmanaged package from AppExchange providing customizable functionality.
- Creating a Visualforce page with an Apex Controller for mass actions.
Retrieving Field Labels
- To access the label of the Stagename field for an Opportunity, use:
-
Opportunity.StageName.getDescribe().getLabel()
-
Handling Button Click Events
- Click events for
lightning:button
components are handled in:- The Controller.js resource of the component bundle.
Developing in Multi-Tenant Environment
- Governor limits ensure that Apex performance does not adversely affect other tenants sharing the same platform.
Deployable Components with Metadata API
- Deployable components via the Metadata API include:
- Account Layout
- Case Layout
Class Variable Access in Triggers
- To set a variable to a class variable in a trigger, use:
-
InsuranceRates.smokerCharge
-
Change Set Deployment Issues
- If a change set deployment fails due to managed package unit tests, select:
- 'Run local tests' to execute all tests in the org that are not in the managed package.
Custom Visualforce Button Attributes
- Required attributes for a custom Visualforce button include:
- Action
- Extensions
- StandardController
Throwing Custom Exceptions
- To throw a custom exception of type MissingFieldValueException, you can use:
-
throw new MissingFieldValueException('Problem occurred')
-
throw new MissingFieldValueException()
-
Reusing Test Setup Methods
- Within test methods, use:
-
SELECT Id FROM Account WHERE Name = 'Test'
to access previously created records.
-
Coverage for Deployment
- For deploying Visualforce pages and custom controllers, create a test class that covers:
- The custom controller.
Method Invocation and Sharing Settings
- Method invocations using the Developer Console respect organization-wide defaults and sharing settings.
SOQL Query Child Records Limit
- SOQL allows accessing a maximum of:
- 1 level of child records in a single query from a parent object.
Valid Assignments for Formula Fields
- Valid assignments from a custom formula field (Number) include:
- Double and Decimal types.
Dynamic Record Type Identification
- To dynamically determine Record Type ID:
- Use
getRecordTypeInfosByName()
from DescribeSObjectResult or execute a SOQL query on the RecordType object.
- Use
Formula Fields Rules
- Formula fields can reference other formula fields only one level deep.
- Deleting referenced fields requires modification of the formula.
DML Records Governor Limits and Outcomes
- If the DML update exceeds governor limits:
- The Account save fails, resulting in no updates to Contacts or Cases.
Importing Accounts Without Duplicates
- Use the Data Import Wizard for importing accounts while avoiding duplicate entries based on existing Account Sites.
Visualforce Page Embedding
- To embed a Visualforce page in an Account layout, include:
-
standardController="Account"
in the<apex:page>
tag.
-
Searching with SOSL
- Queries matching search criteria in any searchable fields include:
-
[FIND 'Acme*' RETURNING Account, Opportunity]
-
[FIND 'Acme*' IN ALL FIELDS RETURNING Account, Opportunity]
-
Lightning Component Benefits
- Benefits of the Lightning Component framework:
- Event-driven architecture for improved component decoupling.
- Accelerated development using pre-built components for all devices.
Employee Rating Program Implementation
- To implement the rating program:
- Create a lookup relationship between the Rating and Employee objects.
- Use a trigger on the Rating object to update Employee records.
Storing Searchable Descriptions
- For searchable product descriptions in SOQL queries, use:
- Text Area field type.
Visualforce Page Picklist Values Retrieval
- To get picklist values and record types for Opportunity:
- Use Schema.PicklistEntry from
Opportunity.StageName.getDescribe()
. - Use Schema.RecordTypeInfo from
Opportunity.SObjectType.getDescribe()
.
- Use Schema.PicklistEntry from
Custom Controller Functionality
- Expected output on accessing the custom page includes values based on the method calls in the custom controller.
Trigger vs. Workflow
- Triggers should be used for tasks like:
- Setting the primary Contact on an Account record upon saving.
Valid Apex Assignments
- A valid assignment involving decimal numbers is:
-
Double x = 5
-
Model in MVC on Force.com
- The model in MVC is represented by:
- A list of Account records returned from a Controller Extension method.
Processing Records in Triggers
- Best practices when processing records in triggers:
- Utilize a Map for efficient SOQL calls.
- Utilize a Set to maintain unique query values.### Future Methods and DML Operations
- Utilize @future methods to perform DML operations asynchronously, improving overall application performance.
- Implement a Map to minimize SOQL calls by grouping records.
- Use a Set to maintain distinct values when filtering queries.
Controller Extension Requirements for Save Action
- Construct the controller extension with a constructor accepting an instance of StandardController.
- Implement a method named Save with a return type of PageReference to override the standard Save action.
SOQL Query Limitations with Sets
- Leverage a Set in the WHERE clause of a SOQL query to restrict the results returned based on unique values contained in the Set.
Task and Activity Timeline Management
- Adjust Activity Settings to prevent tasks from appearing on the Activity Timeline of a Contact’s Account by unchecking the roll-up activities option.
Monitoring @Future Method Invocations
- Use the Apex Jobs system monitoring feature to review details of invoked @future methods.
Benefits of a Trigger Framework
- Enhance trigger maintenance and testing by isolating trigger logic from the trigger itself.
- Standardize triggers for consistent operation across the application.
- Control the order of execution with a single trigger per object.
Managed Packages Creation
- Managed Packages can only be built in a Developer Edition org.
SOQL Governor Limit Alerts in Triggers
- Implement Limits.getQueries() to notify users of impending SOQL governor limit violations in triggers.
Common Trigger Failures
- Ensure SOQL queries are not placed within loops to prevent execution errors and governor limit issues.
Roll-Up Summary Fields and Averages
- To calculate averages in a Master-Detail relationship, utilize both a SUM roll-up summary field and a COUNT roll-up summary field.
Data Modeling for Employer Relationships
- Establish a simple lookup relationship to associate individuals with their employers rather than more complex junction objects.
Code Block Analysis
- Ensure that loop logic and variable initialization are correctly designed to avoid execution failures.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge on managing records in Salesforce with these flashcards. This quiz will help you understand the various methods for mass editing, updating, and deleting records effectively.