Dev II

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Romiero
R
Romiero
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,485
Questions: 11 | Attempts: 1,486

SettingsSettingsSettings
Dev II - Quiz

.


Questions and Answers
  • 1. 

    What features are available when writing apex test classes? (Choose 2 Answers)

    • A.

      The ability to select error types to ignore in the developer console.

    • B.

      The ability to write assertions to test after a @future method.

    • C.

      The ability to set and modify the CreatedDate field in apex tests.

    • D.

      The ability to set breakpoints to freeze the execution at a given point

    • E.

      The ability to select testing data using csv files stored in the system. 

    Correct Answer(s)
    C. The ability to set and modify the CreatedDate field in apex tests.
    E. The ability to select testing data using csv files stored in the system. 
    Explanation
    The two features available when writing apex test classes are the ability to set and modify the CreatedDate field in apex tests and the ability to select testing data using csv files stored in the system.

    Rate this question:

  • 2. 

    What is the easiest way to verify a user before showing them sensitive content?

    • A.

      Sending the user a SMS message with a passcode.

    • B.

      Calling the generateVerificationUrl method in apex.

    • C.

      Sending the user an Email message with a passcode.

    • D.

      Calling the Session.forcedLoginUrl method in apex.

    Correct Answer
    B. Calling the generateVerificationUrl method in apex.
    Explanation
    The easiest way to verify a user before showing them sensitive content is by calling the generateVerificationUrl method in apex. This method generates a verification URL that can be sent to the user. By clicking on the URL, the user can be redirected to a verification page where they can confirm their identity before accessing the sensitive content. This method eliminates the need for sending SMS or email messages with passcodes, making it a simpler and more efficient verification process.

    Rate this question:

  • 3. 

    A developer runs the following anonymous code block: List<Account> acc = [SELECT Id FROM Account LIMIT 10]; Delete acc; Database.emptyRecycleBin(acc); system.debug(Limits.getDMLStatements()+ ', ' +Limits.getLimitDMLStatements()); What is the result?

    • A.

      11, 150

    • B.

      150, 2

    • C.

      150, 11

    • D.

      2, 150

    Correct Answer
    D. 2, 150
    Explanation
    The code block first queries for 10 Account records and stores them in the acc variable. Then, it attempts to delete the acc variable, which is not possible because it is a List and not an individual record. The code then tries to empty the recycle bin for the acc variable, but since it is not a record, this operation does not affect the recycle bin. Finally, the system.debug() statement outputs the number of DML statements used and the limit for DML statements, which is 2 and 150 respectively. Therefore, the result is 2, 150.

    Rate this question:

  • 4. 

    On which object can an administrator create a roll-up summary field?

    • A.

      Any object that is on the master side of a master-detail relationship.

    • B.

      Any object that is on the parent side of a lookup relationship.

    • C.

      Any object that is on the detail side of a master-detail relationship.

    • D.

      Any object that is on the child side of a lookup relationship.

    Correct Answer
    A. Any object that is on the master side of a master-detail relationship.
    Explanation
    An administrator can create a roll-up summary field on any object that is on the master side of a master-detail relationship. This is because a roll-up summary field calculates values from related records and displays the result on the master record. In a master-detail relationship, the master record controls the behavior and access to the detail records, making it the appropriate object to create a roll-up summary field.

    Rate this question:

  • 5. 

    Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

    • A.

      The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object.

    • B.

      The Lookup Relationship cannot be marked as required on the page layout for the Custom Object.

    • C.

      The Custom Object will be deleted when the referenced Standard Object is deleted.

    • D.

      The Custom Object inherits security from the referenced Standard Objects

    Correct Answer
    C. The Custom Object will be deleted when the referenced Standard Object is deleted.
    Explanation
    The correct answer is that the Custom Object will be deleted when the referenced Standard Object is deleted. This is because a Lookup Relationship creates a dependency between the two objects, where the Custom Object relies on the existence of the Standard Object. If the Standard Object is deleted, the Custom Object no longer has a valid reference and is also deleted.

    Rate this question:

  • 6. 

    Where can debug log filter settings be set? Choose 2 answers

    • A.

      The Filters link by the monitored user's name within the web UI

    • B.

      The Show More link on the debug log's record

    • C.

      On the monitored user's name.

    • D.

      The Log Filters tab on a class or trigger detail page.

    Correct Answer(s)
    A. The Filters link by the monitored user's name within the web UI
    D. The Log Filters tab on a class or trigger detail page.
    Explanation
    The debug log filter settings can be set in two places. First, they can be set by clicking on the "Filters" link next to the monitored user's name within the web UI. Second, they can be set on the "Log Filters" tab on a class or trigger detail page.

    Rate this question:

  • 7. 

    On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL?

    • A.

      Use the constructor method for the controller

    • B.

      Use the $Action.View method in the Visualforce page

    • C.

      Create a new PageReference object with the Id.

    • D.

      Use the tag in the Visualforce page.

    Correct Answer
    A. Use the constructor method for the controller
    Explanation
    In order to retrieve a record by using an ID passed on the URL in a Visualforce page with a custom controller, the developer should use the constructor method for the controller. This method allows the developer to access the ID parameter from the URL and use it to query the record from the database. By retrieving the record in the constructor, the developer can then use it to populate the page fields or perform any necessary operations.

    Rate this question:

  • 8. 

    A developer has the following code block:   public class PaymentTax { public static decimal SalesTax = 0.0875; } trigger OpportunityLineItemTrigger on OpportunityLineItem (before insert, before update) { PaymentTax PayTax = new PaymentTax(); decimal ProductTax = ProductCost * XXXXXXXXXXX; } To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger?

    • A.

      SalesTax

    • B.

      PayTax.SalesTax

    • C.

      PaymentTax.SalesTax

    • D.

      OpportunityLineItemTngger.SalesTax

    Correct Answer
    C. PaymentTax.SalesTax
    Explanation
    The SalesTax variable is defined as a public static variable within the PaymentTax class.
    Since it is public static, it can be accessed using the class name PaymentTax followed by the variable name SalesTax.
    Therefore, PaymentTax.SalesTax is the correct syntax to access the value of SalesTax within the trigger.

    Rate this question:

  • 9. 

    What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which then results in hitting a governor limit?

    • A.

      Any changes up to the error are saved.

    • B.

      Any changes up to the error are rolled back.

    • C.

      All changes before a savepoint are saved.

    • D.

      All changes are saved in the first Apex class.

    Correct Answer
    B. Any changes up to the error are rolled back.
    Explanation
    When a Visualforce page calls an Apex controller, which in turn calls another Apex class, if hitting a governor limit occurs, any changes made up to the error will be rolled back. This means that any modifications or updates made before reaching the governor limit will not be saved and will be reverted back to their previous state.

    Rate this question:

  • 10. 

    When the number of record in a recordset is unknown, which control statement should a developer use to implement a set of code that executes for every record in the recordset, without performing a .size() or .length() method call?

    • A.

      For (init_stmt, exit_condition; increment_stmt) { }

    • B.

      Do { } While (Condition)

    • C.

      For (variable : list_or_set) { }

    • D.

      While (Condition) { ... }

    Correct Answer
    C. For (variable : list_or_set) { }
    Explanation
    The correct answer is "For (variable : list_or_set) { }". This control statement is known as a "for-each" loop and is used to iterate through elements in a list or set without needing to know the size of the collection beforehand. It automatically handles the iteration and provides access to each element in the collection one at a time.

    Rate this question:

  • 11. 

    Which one do you like?

    • A.

      Option 1

    • B.

      Option 2

    • C.

      Option 3

    • D.

      Option 4

    Correct Answer
    A. Option 1

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 11, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • May 27, 2020
    Quiz Created by
    Romiero
Back to Top Back to top
Advertisement