Sales Force DEV-501 Certified Force Advanced Developer Test Set 6

Which trigger context variable allows you to modify field values before they are written to the
database in the before trigger?


Options are :

  • Trigger.new (Correct)
  • RETURNING
  • @ReadOnly
  • Webservice

Answer : Trigger.new

Which keywords do developers use to handle exceptions in Apex?


Options are :

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

Answer : GET, POST, PUT, DELETE

Which fields are returned by sosl by default?


Options are :

  • 6
  • 1
  • 200
  • Ids (Correct)

Answer : Ids

Which trigger context variable cannot be deleted?


Options are :

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

Answer : Trigger.new

How are programmatic cusomizations done in Salesforce?


Options are :

  • Apex classes
  • Dates, Ids, Numbers
  • Apex, Visualforce, and APIs (Correct)
  • Apex process classes

Answer : Apex, Visualforce, and APIs

What is the list of steps to match regular expressions using the Pattern and Matcher classes?


Options are :

  • 1. Instantiate a pattern object from the expression you wish to match. 2. Instantiate a matcher object from the pattern that contains the string you want to check. 3. Use the matcher object to detect if the matcher matches the pattern. (Correct)
  • Primitive, sObject, Collections, Null
  • A template from which objects are created
  • HTTPRequest, HTTPResponse, HTTP

Answer : 1. Instantiate a pattern object from the expression you wish to match. 2. Instantiate a matcher object from the pattern that contains the string you want to check. 3. Use the matcher object to detect if the matcher matches the pattern.

What two forms of dml operations can be used in apex?


Options are :

  • Failure response settings
  • Traditional for loops
  • Standalone, database class methods (Correct)
  • SOQL statements

Answer : Standalone, database class methods

What types of sharing are available to developers to share records?


Options are :

  • Dates, Ids, Numbers
  • Manual sharing, apex sharing (Correct)
  • Failure response settings
  • Apex, Visualforce, and APIs

Answer : Manual sharing, apex sharing

What is the default return type of a sosl statement?


Options are :

  • Apex classes
  • SOQL for loops
  • List of List Objects (Correct)
  • Apex process classes

Answer : List of List Objects

What term indicates that Salesforce is a platform which allows clients to share hardware, storage
and other infrastructure?


Options are :

  • System
  • Multi-tenant (Correct)
  • TRUE
  • On-demand

Answer : Multi-tenant

Under what profile do Webservice methods execute by default?


Options are :

  • No
  • TRUE
  • System (Correct)
  • FALSE

Answer : System

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)
A.
Strongly Typed.
B.
Object Oriented.
C.
Uses Java-like syntax.
D.
Acts like database stored procedures.


Options are :

  • A,B,C
  • B
  • A
  • A,B,C,D (Correct)

Answer : A,B,C,D

Which trigger context variable allows you to modify field values before they are written to the
database in the before trigger?


Options are :

  • TRUE
  • Trigger.new (Correct)
  • Trigger.old
  • @ReadOnly

Answer : Trigger.new

What is the size of the batches in which triggers execute?


Options are :

  • FALSE
  • Java
  • 200 (Correct)
  • No

Answer : 200

What components must be deployed manually to the production environment?


Options are :

  • Dates, Ids, Numbers
  • Multi-tenant
  • Constructor
  • Queues, time triggers (Correct)

Answer : Queues, time triggers

The system method, ___________, lets you write test methods that change user contexts to either
an existing user or a new user.


Options are :

  • System.testAs()
  • None of these
  • System.runAs() (Correct)
  • System.runAsUser()
  • System.testAsUser
  • System.impersonateUser()

Answer : System.runAs()

What does Apex use to record disruptions in code execution?


Options are :

  • Catch
  • Exceptions (Correct)
  • Webservice
  • @ReadOnly

Answer : Exceptions

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


Options are :

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

Answer : SOQL statements

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


Options are :

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

Answer : Trigger.new

The System.runAs() functionality can be used to test and verify proper data sharing and data
access. However, System.runAs() does NOT validate CRUD or Field Level Security permissions.


Options are :

  • True
  • False (Correct)

Answer : False

What are the three ways to run unit tests?


Options are :

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

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

What components of apex are available to improve the processing of data in Salesforce?


Options are :

  • GET, POST, PUT, DELETE
  • Batch apex, apex scheduler.
  • Internal and external
  • Database class method (Correct)

Answer : Database class method

Which access modifier should u specify for a class containing the webService keword?
Public
Private
Protected
Global


Options are :

  • 3 MB
  • FALSE
  • Global (Correct)
  • 6

Answer : Global

Each setSavepoint() and rollback statement counts against the total number of DML statements.


Options are :

  • 6
  • Ids
  • TRUE (Correct)
  • 200

Answer : TRUE

Which invocation method occurs when triggers are called by the Force.com platform during the
save process?

Explicit invocation

Implicit invocation

Explicit invocation using anonymous blocks

 External API invocation


Options are :

  • Implicit invocation (Correct)
  • Primitive
  • SOQL for loops
  • RETURNING

Answer : Implicit invocation

Which of the following code will u use to instantiate a map called numbers that has integers as
keys and strings as values?
Map<SLrng, :nLeger> numbers = new Map<String, Integer>;
Map<ThLeyer, SLring> numbers = new Map<Integer, String>;
Map<nLeger> numbers = new Map<String>;
Map<Slring> numbers = new Map<Integer>;


Options are :

  • Code contained in a trigger
  • Manual sharing, apex sharing
  • Map numbers = new Map; (Correct)
  • Failure response settings

Answer : Map numbers = new Map;

List the HTTP classes available in Salesforce?


Options are :

  • GET, POST, PUT, DELETE
  • Failure response settings
  • HTTPRequest, HTTPResponse, HTTP (Correct)
  • Failure response settings

Answer : HTTPRequest, HTTPResponse, HTTP

The system method, System.runAs(), lets you write test methods that change user contexts to
either an existing user or a new user.


Options are :

  • True (Correct)
  • False

Answer : True

Apex code can be initiated in what ways? (Select all that apply)
A.
Web service requests.
B.
Triggers on objects.
C.
More?? Is "Button Clicks" a valid choice?


Options are :

  • A,B,C,D
  • A
  • B
  • A,B,C (Correct)

Answer : A,B,C

In what code is the webservice keyword not allowed to be used?


Options are :

  • Implicit invocation
  • Code contained in a trigger (Correct)
  • Class, trigger
  • Queues, time triggers

Answer : Code contained in a trigger

What are two key tools to debug code in Salesforce?


Options are :

  • List of List Objects
  • Debug logs, email logs
  • Dates, Ids, Numbers
  • Logs, anonymous blocks (Correct)

Answer : Logs, anonymous blocks

What keyword is used to create custom Web Services from an apex method?


Options are :

  • Webservice
  • TRUE
  • FALSE
  • Trigger.new (Correct)

Answer : Trigger.new

What is the this keyword used to represent?


Options are :

  • Methods and attributes of the current instance of a class (Correct)
  • Salesforce ui, force.com ide, runTests web service
  • A template from which objects are created
  • HTTPRequest, HTTPResponse, HTTP

Answer : Methods and attributes of the current instance of a class

How are static methods and attributes access?


Options are :

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

Answer : Through class itself

What are two ways to invoke a custom web service?


Options are :

  • List of List Objects
  • Ajax toolkit, client program (Correct)
  • Apex process classes
  • A governor limit

Answer : Ajax toolkit, client program

Which statement is true about an Apex class?
A class cannot be disabled for profiles.
An inner class can be nested at multiple levels.
Static methods can only be declared in a top-level class definition.
The default access modifier for methods in a class is public.


Options are :

  • Salesforce-generated email address
  • Make calls to methods using both valid and invalid inputs.
  • Manual sharing, apex sharing
  • Static methods can only be declared in a top-level class definition. (Correct)

Answer : Static methods can only be declared in a top-level class definition.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions