Salesforce DEV-501 Apex Visualforce Controller Practice Exam Set 6

Which syntax should you use to create a new public class named MyNewClass?  ? Public class MyNewClass {}  ? Class public MyNewClass {} ? Class MyNewClass {} public ? MyNewClass public {} class(No Answer)


Options are :

  • Database class method
  • SOQL statements
  • Static and final
  • Public class MyNewClass (Correct)

Answer : Public class MyNewClass

An area of a page that uses styling similar to the appearance of a Salesforce detail page, but without any default content.


Options are :

  • apex:include
  • apex:pageBlock (Correct)
  • apex:commandLink
  • apex:chartTips

Answer : apex:pageBlock

What are the three ways to run unit tests?


Options are :

  • System-defined, user-defined
  • FALSE, they must be static
  • Dates, Ids, Numbers
  • Salesforce ui, force.com ide, runTests web service (Correct)

Answer : Salesforce ui, force.com ide, runTests web service

Universal Containers tracks reviews as a custom object in a recruiting application. An interview score is tracked on each review record and should be numerical, so that hiring managers can perform score calculations. The scores should be restricted to Integer values l through 5 and displayed as a set of radio buttons. How can a developer meet this requirement?


Options are :

  • Create a formula field that displays the interview score as a set of radio buttons
  • Create a Visualforce component to display the interview score as a set of radio buttons
  • Create the Interview Score field with a data type of radio button (Correct)
  • Create the Interview Score field as a picklist, displayed as a radio button on the page layout

Answer : Create the Interview Score field with a data type of radio button

Which trigger context variable is not saved in the after trigger and causes an exception to be thrown?


Options are :

  • Trigger.new (Correct)
  • TRUE
  • addError
  • Primitive

Answer : Trigger.new

What statements are used to retrieve records from an sObject in the Force.com database?


Options are :

  • On-demand
  • Map, List, Set
  • SOQL statements (Correct)
  • Exceptions

Answer : SOQL statements

A ____________ is a class written in Apex that implements all of a page's logic, without leveraging a standard controller.


Options are :

  • Controller Extension
  • Custom Controller (Correct)
  • Visualforce Component
  • None of the above
  • Validation Extension
  • Visualforce Plugin

Answer : Custom Controller

If the error message contains HTML markup, the escaped markup displays as text and isn't rendered in the user interface. (Select all that apply)


Options are :

  • Uses Java-like syntax.
  • A,B,C,D (Correct)
  • Object Oriented.
  • Acts like database stored procedures.
  • Strongly Typed.

Answer : A,B,C,D

Which is a valid formula return type for a custom formula field? Choose 3 answers


Options are :

  • Percent
  • Email
  • Phone
  • Currency
  • Date (Correct)

Answer : Date

What statements are used to retrieve records from an sObject in the Force.com database? (No Answer)


Options are :

  • SOQL for loops
  • SOQL statements (Correct)
  • sObject
  • multi-tenant

Answer : SOQL statements

An HTML input element of type checkbox. Use this component to get user input for a controller method that does not correspond to a field on a Salesforce object.


Options are :

  • apex:inputCheckbox (Correct)
  • apex:componentBody
  • apex:actionPoller
  • apex:dataList

Answer : apex:inputCheckbox

What three classes along with the Messaging.InboundEmailHandler are used to handle  inbound email messages in Salesforce? (No Answer)


Options are :

  • Messaging.InboundEmail, Messaging.InboundEmailResult, Messaging.InboundEnvelope (Correct)
  • Make calls to methods using both valid and invalid inputs.
  • Apex code, Visualforce pages, and controllers
  • Messaging.InboundEmailHandler

Answer : Messaging.InboundEmail, Messaging.InboundEmailResult, Messaging.InboundEnvelope

A custom Visualforce component. All custom component definitions must be wrapped inside a single <apex:component> tag.


Options are :

  • apex:commandLink
  • apex:component (Correct)
  • apex:dataTable
  • apex:includeScript

Answer : apex:component

What are all the datatypes that Salesforce supports? (No Answer)


Options are :

  • Primitive, sObject, Collections, Null (Correct)
  • List of List Objects
  • SOAP Web Service Callouts
  • GET, POST, PUT, DELETE

Answer : Primitive, sObject, Collections, Null

A button that is rendered as an HTML input element with the type attribute set to submit, reset, or image, depending on the <apex:commandButton> tag's specified values. The button executes an action defined by a controller, and then either refreshes the current page, or navigates to a different page based on the  PageReference variable that is returned by the action.An <apex:commandButton> component must always be a child of an <apex:form> component. See also: <apex:commandLink>


Options are :

  • apex:flash
  • apex:emailPublisher
  • apex:emailPublisher
  • apex:commandButton (Correct)

Answer : apex:commandButton

Which trigger context variable cannot be deleted?


Options are :

  • @ReadOnly
  • Trigger.new (Correct)
  • addError
  • System

Answer : Trigger.new

How are static methods and attributes access?


Options are :

  • Map, List, Set
  • Class, trigger
  • Apex classes
  • Through class itself (Correct)

Answer : Through class itself

The standard detail page for a particular object, as defined by the associated page layout for the object in Setup. This component includes attributes for including or excluding the associated related lists, related list hover links, and title bar that appear in the standard Salesforce application interface.


Options are :

  • apex:pageblockSection
  • apex:detail (Correct)
  • apex:component
  • apex:insert

Answer : apex:detail

A text area input element. Use this component to get user input for a controller method that does not correspond to a field on a Salesforce object, for a value that requires a text area.


Options are :

  • apex:inputTextarea (Correct)
  • apex:attribute
  • apex:facet
  • apex:include

Answer : apex:inputTextarea

What annotation can be used with Web Services to allow unrestricted queries when no DML operations are necessary? (No Answer)


Options are :

  • TRUE
  • For loops
  • RETURNING
  • @ReadOnly (Correct)

Answer : @ReadOnly

Which trigger context variable cannot be deleted? (No Answer)


Options are :

  • Exceptions
  • Trigger.new (Correct)
  • RETURNING
  • on-demand

Answer : Trigger.new

In which Salesforce environments will the Force.com record IDs be identical?


Options are :

  • Force.com record IDs are never identical.
  • Production, Full Copy Sandbox, and Developer Sandbox
  • Production and Developer Sandbox only
  • Production and Full Copy Sandbox only (Correct)

Answer : Production and Full Copy Sandbox only

What does Apex use to record disruptions in code execution? (No Answer)


Options are :

  • Exceptions (Correct)
  • Ids
  • addError
  • Primitive

Answer : Exceptions

This tag acts as a placeholder for your dynamic Apex components. It has one required parametercomponent Valuewhich accepts the name of an Apex method that returns a dynamic component. The following Visualforce components do not have dynamic Apex representations: <apex:actionRegion> <apex:attribute> <apex:component> <apex:componentBody> <apex:composition> <apex:define> <apex:dynamicComponent> <apex:flash> <apex:inputFile> <apex:include> <apex:insert> <apex:pageMessage> <apex:pageMessages> <apex:variable> <apex:vote> Any non-<apex:> tag, like <chatter:>, <flow:>, <ideas:>, <knowledge:>, <messaging:>, or <site:>


Options are :

  • apex:actionSupport
  • apex:dataList
  • apex:dynamicComponent (Correct)
  • apex:insert

Answer : apex:dynamicComponent

An HTML table that is defined by iterating over a set of data, displaying information about one item of data per row. The body of the <apex:dataTable> contains one or more column components that specify what information should be displayed for each item of data. The data set can include up to 1,000 items.


Options are :

  • apex:listViews
  • apex:dataTable (Correct)
  • apex:inputHidden
  • apex:define

Answer : apex:dataTable

Which keywords do developers use to handle exceptions in Apex?


Options are :

  • Static and final
  • GET, POST, PUT, DELETE (Correct)
  • Through class itself
  • Throw, try, catch, finally

Answer : GET, POST, PUT, DELETE

What name identifies datatypes such as Integer, Boolean, String and Enum in Salesforce?


Options are :

  • FALSE
  • Trigger.new
  • @ReadOnly
  • Primitive (Correct)

Answer : Primitive

The email publisher lets support agents who use Case Feed compose and send email messages to customers. You can customize this publisher to support email templates and attachments. This component can only be used in organizations that have Case Feed and Email-to-Case enabled. Ext JS versions less than 3 should not be included on pages that use this component.


Options are :

  • apex:pageBlock
  • apex:define
  • apex:emailPublisher (Correct)
  • apex:component

Answer : apex:emailPublisher

Good Apex tests should....


Options are :

  • None of these
  • Use the isTest annotation. Classes defined with the isTest annotation do not count against your organization limit of 3 MB for all Apex code. See IsTest Annotation.
  • Exercise bulk trigger functionality—use at least 20 records in your tests.
  • Access live organization data to validate SOQL queries and DML operations.
  • A,D,E (Correct)
  • Use the runAs method to test your application in different user contexts.
  • Only test code using the Standard User profile.

Answer : A,D,E

In a recruiting application, a custom object called Position requires approval. When a position record is submitted for approval, the requirements below must be met: ? The hiring manager must approve the record ? The approval must be forwarded to all members of the executive team, but only one executive needs to approve the record ? The VP of human resources must approve the record How would a developer meet this requirement?


Options are :

  • Create an approval process which utilizes parallel approvers, but does not require unanimous approval. (Correct)
  • Create an approval process with a step for each executive team member, allowing approval steps to be skipped.
  • Create parallel workflow rules, requiring at least one executive team member to complete their assigned task.
  • Create multiple approval processes, one for each executive team member, and utilize parallel submission.

Answer : Create an approval process which utilizes parallel approvers, but does not require unanimous approval.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions