
Dev 1 3/17
Authored by Megan Santos
Business
1st Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A developer wishes to write a test for a private method within a class, how can this be best achieved?
Write a test which executes the public method which calls the private method to be tested
Annotate the private method with @TestVisible
Annotate the test class with @Istest(seePrivate=true)
Change the access modifier to be public
Answer explanation
Using the @TestVisible annotation allows a test method to access a private or protected method or class variable, instanced or static. This
change in access is only applied for test classes and doesn’t affect the access of the class in any other way.
Utilising this annotation allows the original access modifier to be used without sacrificing the ability to precisely test a specific piece of code
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
You have a Visualforce page displaying an Opportunity record. You wish to display details about the Account record linked to this Opportunity.
This page utilises the standard controller. How could you add the Account name to the page?
Create a controller extension which queries the required details on Account
Reference the Account fields using {!opportunity.Account.fieldName}
Replace the standard controller with the standard relationship controller
Write a custom controller to query all required records
Answer explanation
The standard controller for Visualforce provides lots of data access opportunities for the record it is operating on. Notably, it allows access to parent objects, being able to traverse up 5 levels of parent child relationships. For example, you could access details about an Account records owner from an Opportunity. The standard controller also offers 1 level of parent-child traversal, i.e. you could access the Contacts belonging to an Account.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would be the result of executing the following Apex test?
The test would successfully run
A “List has no rows for assignment to SObject” error would be thrown
A “Index 0 is out of bounds” error would be thrown
The System.assert() would fail
Answer explanation
When running a query which returns no rows, a “List has no rows for assignment to SObject” error will be thrown. An index out of bounds error
would not be thrown in this scenario since we are not directly trying to access an element from an array.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A custom field was added to Opportunity which has become redundant due to new business processes. What must be done before deleting the
field?
Remove all references to the field within the org
Set the Field Usage value on the field to DeprecateCandidate
Schedule the field for deletion via the API
Remove all field values on all Opportunity records
Answer explanation
Before a field can be deleted all references to that field must be removed. These references could be found within declarative tools, such as
reports and flows, or within code. Attempting to delete the field which is referenced elsewhere will throw an error.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the primary purpose of creating test classes in Apex?
Generate enough code coverage for deployment
Ensure the code executes successfully
Test that the logic within a class is behaving as expected
To check for conflicts with configuration changes
Answer explanation
Test classes within Salesforce play a very important role: they are used to determine whether a piece of code is behaving exactly as it was
intended to.
Properly written tests can act as early warning signs for when things go wrong, and can help easily identify specific pieces of code that are no
longer behaving as expected (for example, due to conflicting with a recently introduced Process Builder or Flow).
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A Lead has been converted to a Contact and Account, which triggers are fired?
Only triggers on Contact
Only triggers on Account
Only triggers on Lead
Triggers on Lead, Contact and Account
Triggers on Contact and Account
Answer explanation
Lead conversion causes Apex triggers to fire, the scope of which depends on the records the Lead is being converted to, but at a bare minimum the triggers on the Lead object are fired. If a Lead is creating or updating any secondary objects, those objects also have their triggers fired.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following statements is true about sharing keywords of Apex classes?
Inner classes inherit the sharing mode from the outer class
Inner classes do not inherit the sharing mode from the outer class
Inner classes must match their outer classes sharing mode
Inner classes must always use with sharing
Answer explanation
Inner classes can have their own sharing modes declared, which don’t have to match that of the outer classes. This can be useful for nesting specific methods which require without sharing inside a class which has with sharing declared.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Topic Sentences
Quiz
•
1st - 5th Grade
10 questions
CommQuest - Business Quiz - Rapid Fire Round
Quiz
•
1st - 3rd Grade
10 questions
Entrepreneurship Tutorial 1
Quiz
•
1st Grade
10 questions
Development of Financial Accounting Environment
Quiz
•
KG - University
10 questions
Television Adverts Quiz
Quiz
•
1st Grade
10 questions
Innovation in LEMONADE
Quiz
•
1st - 3rd Grade
10 questions
Factors of Production (Labour)
Quiz
•
1st Grade
10 questions
Principles of Marketing
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Business
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
15 questions
Place Value tens and ones
Quiz
•
1st Grade
16 questions
Money - Coins
Lesson
•
1st - 2nd Grade
20 questions
Halves and Fourths
Quiz
•
1st Grade