Developer School
Developer School
Q.1 which method causes the entire set of operations to be rolled back
a)error()
b)showError()
c)isError()
d)addError()
Q.2 Which Method you will use to declare a method as test method?
a)’@isTest’
b) ’@future’
c) ’@Rest’
d) ’@TestMethod’
Q.3 A developer would like to bypass the total number of records retrieved by SOQL
queries in the start Method.Which class object you would suggest to use?
a)Database.QueryLocator
b)Iteratable
c) Database.QueryRecords
d) Database.Iterable
Q.4 select three different flavours of asynchronous apex ?
a)Batch Apex
b)Future Method
c) Background Queueable
d)Scheduled Apex
Q.5 A developer like to Monitor the progress of future jobs. Suggest the correct way.
a)From Setup ,select Apex Jobs
b) Query ConTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query ConJobDetail to find future job
Q.6 Which Annotation will be used to expose an Apex class as Rest resource?
a) ‘@’RestResource
b) ‘@’ResourceRest
c) ‘@’HttpResource
d) ‘@’RestHttp
Q.7 When making a callout from a method ,the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future.
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true).
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true).
When making a callout from a method, the method waits for the external service to send
back the callout response before executing subsequent lines of code. Alternatively, you can
place the callout code in an asynchronous method that’s annotated
with @future(callout=true) or use Queueable Apex. This way, the callout runs on a separate
thread, and the execution of the calling method isn’t blocked.
Q.8 select the second generation of event products related to streaming API (select 2)
a) Change Data Capture
b) Push Topic Events
c)Generic streaming events
d)Platform events
Q.9 Which are the three methods of Heroku and Salesforce Integration(Select 3)
a) Heroku Connect
b) Salesforce SOAP API’S
c) Callout
d) Canvas
Q.12 What type of jobs do not show up in the Apex Flex Queue?
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
Q.15 A component has an attribute message . Select line appropriate statement to set
the value of message from client-controller method with newMessage.
handleClick2: function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2: Message:” + newMessage);
// Add correct statement below
---------------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
Q.16 Suggest an attribute to a developer to declare that the component handles the
event after changes in the record.
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanged
Q.17 Which attributes of force:recordData is set to localized error message if an error
occurs on loading a component?
a) targetFields
b) targetError
c) error
d) fieldsError
Q.20 A developer called a web services from an apex code which response status code
she should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
When the server processes the request, it sends a status code in the response. The status
code indicates whether the request was processed successfully or whether errors were
encountered. If the request is successful, the server sends a status code of 200. You’ve
probably seen some other status codes, such as 404 for file not found or 500 for an internal
server error.
Q.23 Select the inappropriate reason from the following to integrate apps on Heroku
with salesforce:
a) Data Replication
b) Data Proxies
c) Data Security
d) Custom User Interface
Q.24 Consider the following code. Select appropriate statement to print the value of
message
attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a. {v.message}
b. {! message}
c. {message}
d. {!v.message}
Q.25 Which of the following annotation you will add to your method to expose it as a
REST resource that can be called by an HTTP GET request?
a.) “@”HttpPost
b.)“@”HttpGet
c.) “@”HttpPut
d. )“@”HttpDelete
Q.26 Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
Request headers specify metadata for the request. The request body specifies data for the
request, when necessary. If there’s no data to specify, the body is omitted from the request.
36. Which of the following scenarios describes how you can use a connected app?
A.Users can create their own connected apps to access their personal email accounts.
B.Users can log in to an external application with their Salesforce or Experience Cloud
credentials.
C.Users can authorize a mobile app to securely access defined Salesforce data on their
behalf.
D.B and C
37. What's the difference between a connected app developer and a connected app
admin?
A.Only developers can set policies that explicitly define who can use connected apps and
where they can access the apps from.
B.Only admins can set policies that explicitly define who can use connected apps and
where they can access the apps from.
C.There isn't a difference between developers and admins when it comes to connected
apps.
D.Only developers use connected apps. Admins have no role with connected apps.
38. True or false: OAuth 2.0 APIs enable a user to work in one app but see the data
from another.
A.True
B.False
39. You're creating a connected app that allows a Smart TV to display a customer's
movie order history. Which OAuth 2.0 flow would you use for the connected app?
A.OAuth 2.0 web server flow
B.OAuth 2.0 device flow
C.OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
D.OAuth 2.0 user-agent flow
Using OpenID Connect dynamic client registration, resource servers can dynamically create
client apps as connected apps in Salesforce -- TRUE
When Salesforce acts as your identity provider, you can use a connected app to integrate
your service provider with your org. – FALSE
40. True or false: You can integrate identity providers with Salesforce using connected
apps.
A.True
B.False
41. How is OpenID Connect different from SAML?
A.You can't use OpenID Connect to enable SSO between two services.
B.You can only use OpenID Connect to enable SSO between two services.
C.OpenID Connect is built for today's API economy because it adds an authentication
layer on top of OAuth 2.0.
D.B and C
42. True or false: Dynamic client registration enables resource servers to dynamically
create client apps as connected apps.
A.True
B.False
43. What role does your Salesforce org play in providing authorization for external API
gateways?
A.My Salesforce org requests the creation of client apps as connected apps from the
external API gateway.
B.My Salesforce org hosts the protected data.
C.My Salesforce org is the OAuth authorization server that protects resources hosted on
an external API gateway.
D.My Salesforce org asks the external API gateway to authenticate a client app.
44. Which of the following is NOT an advantage of data replication over data proxies?
A.A replicated data set offloads processing and requests from an origin data server.
B.A replicated data set is always and immediately in sync with the origin data.
C.A replicated data set reduces data access latency.
D.A replicated data set supports bidirectional writes.
45. You can use Salesforce Connect to proxy which types of data sources:
A.OData 2.0 and 4.0
B.REST with JSON payloads
C.REST with XML payloads
D.SOAP
E.All of the above
46. Which technology do Salesforce REST APIs use for authentication?
A.Pre-shared keys
B.Basic usernames and passwords
C.OAuth
D.SAML
47. Callouts from Salesforce to Heroku can be made using:
A.Web sockets
B.Apex triggers or outbound messages
C.Message bus
D.Corba
56. The primary benefit of a workflow outbound message over an Apex trigger is:
A.The message can deliver the payload only as SOAP.
B.The message supports different authentication mechanisms.
C.Messages are completely declarative.
D.The message can handle every database event.
57. Callouts in Apex trigger support which authentication mechanisms:
A.Pre-shared keys
B.Username and password credentials
C.OAuth flows using named credentials in the Remote Site settings
D.All of the above
58. Heroku apps that handle callouts from Salesforce can be written in:
A.Node.js / JavaScript
B.Java, Scala, Clojure
C.Python
D.PHP
E.All of the above
• before insert
• before update
• before delete
• after insert
• after update
• after delete
• after undelete
• Before triggers are used to update or validate record values before they’re
saved to the database.
• After triggers are used to access field values that are set by the system (such
as a record's Id or LastModifiedDate field), and to affect changes in other
• records. The records that fire the after trigger are read-only.
62. What is a key benefit of asynchronous processing?
A.Higher governor and execution limits
B.Unlimited number of external callouts
C.Override organization-wide sharing defaults
D.Enabling turbo mode for transactional processing
63. Batch Apex is typically the best type of asynchronous processing when you want to:
A.Make a callout to a web service when a user updates a record.
B.Schedule a task to run on a weekly basis.
C.Update all records in your org.
D.Send a rickroll email to a contact.
Future Apex
Future methods are typically used for:
• Callouts to external Web services. If you are making callouts from a trigger or after
performing a DML operation, you must use a future or queueable method. A callout
in a trigger would hold the database connection open for the lifetime of the callout
and that is a "no-no" in a multitenant environment.
• Operations you want to run in their own thread, when time permits such as some sort
of resource-intensive calculation or processing of records.
• Isolating DML operations on different sObject types to prevent the mixed DML error.
This is somewhat of an edge-case but you may occasionally run across this issue.
See sObjects That Cannot Be Used Together in DML Operations for more details.
@future
@isTest
public class SMSCalloutMock implements HttpCalloutMock {
public HttpResponse respond(HttpRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"status":"success"}');
res.setStatusCode(200);
return res;
}
Batch Apex
Batch Apex is used to run large jobs (think thousands or millions of records!) that
would exceed normal processing limits. Using Batch Apex, you can process records
asynchronously in batches (hence the name, “Batch Apex”) to stay within platform
limits. If you have a lot of records to process, for example, data cleansing or
archiving, Batch Apex is probably your best solution.
start
Used to collect the records or objects to be passed to the interface method execute
for processing. This method is called once at the beginning of a Batch Apex job and
returns either a Database.QueryLocator object or an Iterable that contains the
records or objects passed to the job.
Most of the time a QueryLocator does the trick with a simple SOQL query to
generate the scope of objects in the batch job. But if you need to do something
crazy like loop through the results of an API call or pre-process records before being
passed to the execute method, you might want to check out the Custom Iterators
link in the Resources section.
With the QueryLocator object, the governor limit for the total number of records
retrieved by SOQL queries is bypassed and you can query up to 50 million records.
However, with an Iterable, the governor limit for the total number of records
retrieved by SOQL queries is still enforced.
execute
Performs the actual processing for each chunk or “batch” of data passed to the
method. The default batch size is 200 records. Batches of records are not guaranteed
to execute in the order they are received from the start method.
finish
Used to execute post-processing operations (for example, sending an email) and is called
once after all batches are processed.
}
public void finish(Database.BatchableContext bc){
Queueable Apex allows you to submit jobs for asynchronous processing similar to
future methods with the following additional benefits:
Queueable Syntax
To use Queueable Apex, simply implement the Queueable interface.
You can query AsyncApexJob to find your future job, but there’s a caveat. Since
kicking off a future job does not return an ID, you have to filter on some other field
such as MethodName, or JobType, to find your job. There are a few sample SOQL
queries in this Stack Exchange post that might help.
• Web service callouts to SOAP web services use XML, and typically require a WSDL
document for code generation.
• HTTP callouts to services typically use REST with JSON.
These two types of callouts are similar in terms of sending a request to a service and
receiving a response. But while WSDL-based callouts apply to SOAP Web services,
HTTP callouts can be used with any HTTP service, either SOAP or REST.
Some Common HTTP Methods
HTTP Method Description
GET Retrieve data identified by a URL.
POST Create a resource or post data to the server.
DELETE Delete a resource identified by a URL.
PUT Create or replace the resource sent in the request body.
RestResource Annotation
The @RestResource annotation is used at the class level and enables you to expose an
Apex class as a REST resource.
67.which of the following method is used to map the url pattern to RestResource
Annoatation
a)urlPattern
b)urlText
c)urlMap
d)urlMapping
68. Which of the following statements is true about creating apps with Visualforce:
A.Visualforce is designed primarily for page-centric web apps.
B.Visualforce renders the page on the server.
C.Visualforce will be fully supported by Salesforce for years to come.
D.All of the above.
69. Which of the following statements is NOT true about creating apps with Lightning
components:
A.Lightning components are designed primarily for app-centric web apps.
B.Lightning components can be used everywhere Visualforce can be used.
C.Lightning components render the page on the client.
D.All of the above.
70. Which of the following is a poor use of Lightning Components:
A.Developing an app for Salesforce1.
B.Developing a highly interactive app with an innovative user interface.
C.Developing widgets for use in Lightning App Builder.
D.None of the above. All of these are good use cases for Lightning Components.
73. Which of the following statements about Lightning Components and Lightning
Experience is true?
A.Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
B.Lightning Experience is (mostly) built with Lightning Components.
C.Lightning Experience uses an app-centric development model using Lightning
Components.
D.All of the above.
74. Which of the following is true of Aura Components:
A.Aura Components can only be used in the Lightning Experience and not the Salesforce
mobile app.
B.Aura Components can be used in Visualforce pages.
C.Aura Components are only optimized for the desktop experience.
D.All of the above.
75. Which of the following ISV features are available in Lightning Experience?
A.Trialforce.
B.Usage Metrics Visualization app.
C.Package creation.
D.None of the above are available.
76. As an ISV, which of the following is true about AppExchange:
A.Your apps undergo a review for Lightning Experience readiness.
B.Your apps are available to all customers, whether they have enabled Lightning
Experience or not.
C.The 'Lightning Ready' certification lets AppExchange visitors know your app is
verified for Lightning Experience.
D.All of the above.
77. Which of the following is true of Apex in the new Lightning Experience:
A.You have to update the API version for all your Apex classes in order for them to work
in Lightning Experience.
B.Apex is not supported in the new Lightning Experience.
C.Your Apex code and queries continue to function as before.
D.All of the above
78. What should you look for when reviewing your installed packages before using them
with Lightning Experience?
A.A 'Lightning Ready' sash for the package on AppExchange.
B.An error message saying the package isn't 'Lightning Ready'.
C.A 'Lightning Ready' check mark on the Installed Packages page.
D.Errors in the JavaScript console when using the package.
79. Which of the following descriptions about the Lightning Component framework is
true?
A.It's a UI framework for developing web apps for mobile and desktop devices.
B.It uses JavaScript on the client side and Apex on the server side.
C.It's a modern framework for building single-page applications.
D.All of the above
80. What can you build with the Lightning Component framework?
A.Standalone app
B.Components to use inside Visualforce pages
C.Drag-and-drop components for Lightning App Builder
D.All of the above
81. How is the Lightning Component framework different from other web app
frameworks?
A.It is optimized for both mobile and desktop experiences and proves it with Salesforce1
and Lightning Experience.
B.It connects natively with services provided by the Salesforce platform.
C.It has specific opinions about how data access is performed and has specific security
requirements.
D.All of the above
Aura Attribute
Expressions
Instead of getting lost in words again, let’s dive right into making helloMessage work
as intended.
<aura:component>
<aura:attribute name="message" type="String"/>
<p>Hello! {!v.message}</p>
</aura:component>
Copy
We’re outputting the contents of message using the expression {!v.message} . That is,
this expression references the message attribute. The expression is evaluated, and
resolves to the text string that’s currently stored in message . And that’s what the
expression outputs into the body of the component.
{!<expression>}
The formal definition of an expression is a bit intimidating, but let’s look at and then
unpack it: An expression is any set of literal values, variables, sub-expressions, or
operators that can be resolved to a single value.
Let’s look at the helloMessageInteractive controller in more detail, and make that
explanation a bit more concrete.
({
})
The force:recordData tag also supports a set of target * attributes, which are
attributes that force:recordData populates itself. The target * attributes can be used to
allow access from the UI.
89. Which tool you will use to add a Lightning Component on a Record Page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
90. A developer andrew would like to execute or run jobs sequentially. Suggest
which would be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
91. Which class contains the RestRequest and RestResponse objects in RESTful
webservices?
a) Resthttp
b) RestContent
c) RestContext
d) RestContainer
92.Which access specifier you will use for a class and methods to publish them
as SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
93. To start the batch processing we have to use which of the following
method?
a) Database.StartBatch
b) Database.executeBatch
c) Database.processBatch
d) Database.runBatch
94. Select the appropriate options to fill in the blanks which should call the
client-side controller method by clicking on a button of a component
Greet.cmp
<div>
<lightning button label = “You look nice today”
Onclick=”--------------------------”
</div>
Greet.js
{
handleClick : function(cmp,event,helper)
{
alert(“Welcome”);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick }
Ex:-
<aura:component>
<aura:attribute name="text" type="String" default="Just a string. Waiting
for change."/>
<input type="button" value="Flawed HTML Button"
onclick="alert('this will not work')"/>
<br/>
<lightning:button label="Framework Button" onclick="{!c.handleClick}"/>
<br/>
{!v.text}
</aura:component>
95. Select the form-based component from the following which can be used to
display records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm
96. Below given is the controller code for a component. Identify what is missing in the
code.
public with sharing class ExpensesController {
public static List<Expense_c> getExpenses() {
return [SELECT Id, Name, Amount_c, Client_c, Date_c,
Reimbursed_c, CreatedDate
FROM Expense_c];
}
}
a. “@”AuraEnabled annotation for getExpense() ✓
b. “@”AllowAccess annotation for getExpense()
c. “@”isTest annotation for getExpense()
d. “@”Aura annotation for getExpense()
When using force:recordData , load the data once and pass it to child components as
attributes. This approach reduces the number of listeners and minimizes server calls,
which improves performance and ensures that your components show consistent
data.
Loading Records
The first thing you do to make a record available for your UI components is to load it.
Load the record by including force:recordData in your component while specifying
the recordId , mode , and layoutType or fields attributes. Valid values
for layoutType are FULL and COMPACT .
ldsDisplayRecord.cmp
<force:recordData aura:id="record"
fields="Name,BillingCity,BillingState"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields ="{!v.simpleRecord}"
mode="VIEW"/>
Salesforce provides two SOAP API WSDLs for two different use cases. The enterprise WSDL is
optimized for a single Salesforce org. It’s strongly typed, and it reflects your org’s specific
configuration, meaning that two enterprise WSDL files generated from two different orgs
contain different information.
The partner WSDL is optimized for use with many Salesforce orgs. It’s loosely typed,
and it doesn’t change based on an org’s specific configuration. Typically, if you’re
writing an integration for a single Salesforce org, use the enterprise WSDL. For
several orgs, use the partner WSDL.
For this unit, we’re using the enterprise WSDL to explore SOAP API. The first step is
to generate a WSDL file for your org. In your Trailhead Playground, from Setup, enter
API in the Quick Find box, then select API. On the API WSDL page, click Generate
Enterprise WSDL.
On the Generate Enterprise WSDL page, click Generate. When the WSDL is
generated, right-click on the page and save the WSDL file somewhere on your
computer. We’ll be using it shortly.
Here’s a tip for working with the enterprise WSDL. The enterprise WSDL reflects your
org’s specific configuration, so whenever you make a metadata change to your org,
regenerate the WSDL file. This way, the WSDL file doesn’t fall out of sync with your
org’s configuration.
ENDD---------------------------------------------------------------------------------------------------
1) True or false: OAuth 2.0 APIs enable a user to work in one app but see the data from
another.
a) True
b) False
2) You're creating a connected app that allows a Smart TV to display a customer's movie
order history. Which OAuth 2.0 flow would you use for the connected app?
a) OAuth 2.0 web server flow
b) OAuth 2.0 device flow
c) OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
d) OAuth 2.0 user agent flow
4) Batch Apex is typically the best type of asynchronous processing when you want to:
a) Make a callout to a web service when a user updates a record.
b) Schedule a task to run on a weekly basis.
c) Update all records in your org.
d) Send a rickroll email to a contact
6) Which declarative tool would you use for the following use case? Guide customers
through the process of troubleshooting issues with your product.
a) Flow Builder
b) Approvals
c) Apex
7) Which declarative tool would you use for the following use case? When an opportunity's
discount is higher than 40%, notify the CEO via email and request sign-off. Provide a
way for the CEO to leave comments.
a) Flow Builder
b) Approvals
c) Apex
8) Which declarative tool would you use for the following use case? When the Annual
Revenue field exceeds $500,000 on an account, automatically update the Customer
Priority field to High.
a) Flow Builder
b) Approvals
c) Apex
11) What is the name of the framework that includes Aura components?
a) Lightning Components
b) Angular
c) jQuery
d) WebObjects
13) Which of the following descriptions about the Lightning Component framework is true?
a) It’s a UI framework for developing web apps for mobile and desktop devices.
b) It uses JavaScript on the client-side and Apex on the server-side.
c) It’s a modern framework for building single-page applications.
d) All of the above
14) What can you build with the Lightning Component framework?
a) Standalone app
b) Components to use inside Visualforce pages
c) Drag-and-drop components for Lightning App Builder
d) All of the above
15) How is the Lightning Component framework different from other web app frameworks?
a) It is optimized for both mobile and desktop experiences and proves it with
Salesforce1 and Lightning Experience.
b) It connects natively with services provided by the Salesforce platform.
c) It has specific opinions about how data access is performed and has specific
security requirements.
d) All of the above
18) What attributes are required when using force:recordData to load a record when the
component loads?
a) recordId, mode, layoutType, fields
b) recordId, mode, and layoutType or fields
c) recordId, mode, targetRecord
d) recordId, mode, fields, targetRecord, targetError
19) Which of the following is NOT an advantage of data replication over data proxies?
a) A replicated data set offloads processing and requests from an origin data
server.
b) A replicated data set is always and immediately in sync with the origin
data.
c) A replicated data set reduces data access latency.
d) A replicated data set supports bidirectional writes.
20) You can use Salesforce Connect to proxy which types of data sources:
a) OData 2.0 and 4.0
b) REST with JSON payloads
c) REST with XML payloads
d) SOAP
e) All of the above
21) Which technology do Salesforce REST APIs use for authentication?
a) Pre-shared keys
b) Basic usernames and passwords
c) OAuth
d) SAML
24) REST API is best suited for which of these use cases?
a) Loading lots of data into your org for the first time
b) Writing a mobile or web app
c) Deleting 100,000 records at once
d) Pushing notifications whenever data is changed
25) SOAP API is best suited for which of these use cases?
a) Building a server-to-server integration
b) Writing an app that requires using JSON
c) Updating thousands of records at once
d) Building a slick UI for a mobile app
26) Bulk API is best suited for which of these use cases?
a) Deleting several records, one record at a time
b) Writing a mobile chat app
c) Building a new Salesforce UI
d) Deleting 100,000 records at once
27) Streaming API is best suited for which of these use cases?
a) Notifying users whenever a record is deleted
b) Creating hundreds of account records at once
c) Writing an app where the use of XML is required
d) Using a WSDL file to specify the operations allowed on standard and custom
objects
28) What are all the factors that contribute to the total API limit calculation?
a) Org edition and API usage over the previous month
b) Org edition, license type, and expansion packs
c) License type and expansion packs
d) Number of Salesforce employees swabbing the deck
34) Which of the following is NOT an advantage of Salesforce Connect over ETL?
a) The data is always fetched on demand.
b) If the origin is offline, the data is still available via Salesforce Connect.
c) Standard protocols like OData can easily proxy external data into Salesforce.
d) Data security can be enforced using per-user or per-application authentication.
35) True or false: You can integrate identity providers with Salesforce using connected apps.
a) True
b) False
37) Which of the following scenarios describes how you can use a connected app?
a) Users can create their own connected apps to access their personal email
accounts.
b) Users can log in to an external application with their Salesforce or Experience
Cloud credentials
c) Users can authorize a mobile app to securely access defined Salesforce data on
their behalf.
d) B and C
38) What’s the difference between a connected app developer and a connected app admin?
a) Only developers can set policies that explicitly define who can use connected
apps and where they can access the apps from.
b) Only admins can set policies that explicitly define who can use connected apps
and where they can access the apps from.
c) There isn’t a difference between developers and admins when it comes to
connected apps
d) Only developers use connected apps. Admins have no role with connected apps
39) What type of jobs do not show up in the Apex Flex Queue.
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
42) What role does your Salesforce org play in providing authorization for external API
gateways?
a) My Salesforce org requests the creation of client apps as connected apps from
the external API gateway.
b) My Salesforce org hosts the protected data
c) My Salesforce org is the OAuth authorization server that protects resources
hosted on an external API.
d) My Salesforce org asks the external API gateway to authenticate a client app.
43) Which of the following ISV features are available in Lightning Experience?
a) Trialforce
b) Usage Metrics Visualization app.
c) Package creation.
d) None of the above are available.
45) Which of the following is true of Apex in the new Lightning Experience:
a) You have to update the API version for all your Apex classes in order for them to
work in Lightning Experience.
b) Apex is not supported in the new Lightning Experience.
c) Your Apex code and queries continue to function as before.
d) All of the above
46) What should you look for when reviewing your installed packages before using them with
Lightning Experience?
a) A 'Lightning Ready' sash for the package on AppExchange.
b) An error message saying the package isn't 'Lightning Ready'.
c) A 'Lightning Ready' check mark on the Installed Packages page.
d) Errors in the JavaScript console when using the package.
47) The primary benefit of a workflow outbound message over an Apex trigger is:
a) The message can deliver the payload only as SOAP.
b) The message supports different authentication mechanisms.
c) Messages are completely declarative.
d) The message can handle every database event.
49) Heroku apps that handle callouts from Salesforce can be written in:
a) Node.js / JavaScript
b) Java, Scala, Clojure
c) Python
d) PHP
e) All of the above
51) You can build Canvas apps and run them on Heroku with of the following languages:
a) Node.js / JavaScript
b) Java, Scala, Clojure
c) Python
d) PHP
e) All of the above
53) Which of the following statements about Lightning Components and Lightning
Experience is true?
a) Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
b) Lightning Experience is (mostly) built with Lightning Components.
c) Lightning Experience uses an app-centric development model using Lightning
Components.
d) All of the above
55) Applications on Heroku that use Salesforce REST APIs can use which authentication
mechanisms:
a) Anonymous access without credentials on trusted networks
b) Username and password with an OAuth connected app
c) OAuth web or user-agent flow in which the user authorizes a connected app
using browser redirects
d) B and C
e) A and C
59) Which replay option specifies that the subscriber receives event notifications with replay
IDs 6, 7, 8, and 9?
a) 6
b) 5
c) -2
d) -1
60) Which of the following SOQL query a valid pushtopic query? SELECT Name, Phone
FROM Contact WHERE MailingCity=’Indianapolis’
a) WHERE clauses aren’t supported for PushTopics
b) The SELECT statement doesn’t include an ID
c) Contact isn’t a supported object for pushTopic queries
d) The query is valid
61) What channel name corresponds to a platform event that you defined with the label of
solar panel event?
a) /event/Solar_panel_Event
b) /topic/Solar_panel_Event
c) /event/Solar_panel_Event__c
d) /event/Solar panel Event
e) /event/Solar_panel_Event__e
63) Which of the following features of Visualforce do NOT work in Lightning Experience?
a) Creating custom apps and tabs
b) Overriding standard actions with Visualforce pages
c) Using window location in JavaScript code
d) Remote Objects
64) Which of the following is NOT true about the user interface and visual design in Lightning
Experience:
a) PDFs render with the Lightning Experience visual design
b) You can’t hide the Lightning Experience main navigation header or sidebar
c) The <apex:inputField> tag renders with the Salesforce Classic appearance
d) The Standard Visualforce header and sidebar are hidden
65) Which of the following statements is true about creating apps with visualforce:
a) Visualforce is designed primarily for page-centric web apps.
b) Visualforce renders the page on the server.
c) Visualforce will be fully supported by Salesforce for years to come.
d) All of the above
66) Which of the following statements is NOT true about creating apps with Lightning
components:
a) Lightning components are designed primarily for app-centric web apps.
b) Lightning components can be used everywhere Visualforce can be used.
c) Lightning components render the page on the client.
d) All of the above
68) Which attribute of force:recordData is set to a localized error message if an error occurs
on loading a component?
a) targetFields
b) targetError
c) Error
d) fieldsError
69) My Domain is NOT required at the very beginning to develop with Lightning
Components?
a) True
b) False
70) Which tool you will use to add a lightning component on a record page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
71) Select the inappropriate reason from the following to integrate apps on Heroku with
salesforce:
a) Data replication
b) Data proxies
c) Data Security
d) Custom user interfaces
72) Which are two types of SOAP API WSDLs provided by Salesforce? (Select 2)
a) Company WSDL
b) Enterprise WSDL
c) Partner WSDL
d) Person WSDL
73) SOAP web services are commonly used for:
a) Simple, light weight services that are typically stateless.
b) Public APIs that use HTTP and JSON.
c) Enterprise apps that require a formal exchange format or stateful operations.
d) No one uses SOAP any longer
74) Which type of app enables an external application to integrate with Salesforce using API
and standard protocols?
a) Salesforce app
b) Service app
c) Connected app
d) External app
76) A developer, Andrew would like to execute or run jobs sequentially. Suggest which would
be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
77) A developer would like to bypass the total number of records retrieved by SOQL queries
in the start method. Which class object you would suggest to use?
a) Database.QueryLocator
b) Iterable
c) Database.QueryRecords
d) Database.Iterable
78) A developer want to send JSON data through a POST request in the web service. Which
request header should be set to JSON?
a) Data-Type
b) Endpoint
c) Content-Type
d) body
80) Which annotation you will use to declare a method as test method?
a) “@isTest”
b) “@future”
c) “@Rest”
d) “@TestMethod”
81) Which class contains the RestRequest and RestResponse objects in RESTful
webservice?
a) RestHttp
b) RestContent
c) RestContext
d) RestContainer
82) Which of the following attribute is used to map the URL pattern to RestResource
annotation?
a) urlPattern
b) urlText
c) urlMap
d) urlMapping
83) How many maximum number of Apex jobs we could schedule at one time?
a) 50
b) 100
c) 150
d) 200
84) Identify the correct apex class which allows to submit jobs for asynchronous processing
with member variables of Non-primitive types?
a) AsyncApex
b) Stateful
c) Batchable
d) Queueable
85) Select the second generation of event products related to streaming API. (Select 2)
a) Change Data Capture
b) PushTopic Events
c) Generic Streaming Events
d) Platform Events
86) A Developer, Brian, would like to create an optimized WSLD for use with many
salesforce org. Which type of WSDL should he create?
a) Company WSDL
b) Person WSDL
c) Enterprise WSDL
d) Partner WSDL
87) Identify the correct the attribute of force:recordData component which determines what
operations are available to perform with the record
a) Mode
b) recordID
c) Fields
d) LayoutType
89) A developer called a web service from an apex code. Which response status code she
should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
90) A developer is loading a record from the database using force:recordData component.
Which attribute is populated with the loaded record?
a) tagetFields
b) targetRecord
c) targetError
d) targetRow
91) What should be the minimum code coverage % before deploying an apex code?
a) 71
b) 73
c) 75
d) 72
92) Select the inappropriate method from the following which informs the runtime that mock
callouts are used in the test method
a) Test.runAs
b) Test.setMock
c) Test.Mock
d) Test.startTest
93) To make a Lightning component available for any type of page, it must implement which
interface?
a) flexipage:availableForAllPageTypes
b) flexipage:availableForPageTypes
c) flexipage:availableForAllTypes
d) flexipage:ForAllPageTypes
94) Which annotation will be used to expose an apex class as REST resource?
a) “@”RestResource
b) “@”ResourceRest
c) “@”HttpResource
d) “@”RestHttp
95) Which method causes the entire set of operations to be rolled back?
a) error()
b) showError()
c) isError()
d) addError()
96) To get a fresh set of governor limits in an apex test class, which method shall be used?
a) Test.runAs
b) Test.setMock
c) Test.startTest and Test.stopTest
d) Test.assert
97) A developer like to monitor the progress of future jobs. Suggest the correct way.
a) From setup, select Apex Jobs
b) Query CronTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query CronJobDetail to find future job
98) Below given is the controller code for a component. Identify what is missing in the code.
Public with sharing class ExpensesController{
Public static List<Expense__c> getExpenses(){
Return [SELECT Id, Name, Amount__c, Client__c, Date__c,
Reimbursed__c, CreatedDate
FROM Expenses__c];
}
}
a) ‘@’AuraEnabled annotation for getExpense()
b) ‘@’AllowAccess annotation for getExpense()
c) ‘@’isTest annotation for getExpense()
d) ‘@’Aura annotation for getExpense()
99) A component has an attribute message. Select the appropriate statement to set the
value of message from client-controller method with newMessage.
handleCLick2:function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2:Message:”+newMessage);
//Add correct statement below
—--------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{!v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
100) A Developer, Amy, would like to create an optimized WSLD for a single salesforce
org. Which type of WSDL should she create?
e) Company WSDL
f) Person WSDL
g) Enterprise WSDL
h) Partner WSDL
101) A Lightning component developer want to fetch data of a custom object Review__c
from database and want to display on a component. What type of controller should be
used?
a) Standard List Controller
b) Extension Controller
c) Client-side Controller with Server-side Controller
d) Standard Controller
102) Identify the correct trigger variable which shows the currently executing code in apex
trigger.
a) isInsert
b) isExecuting
c) isAfter
d) isDelete
103) Select the appropriate option to fill in the blanks which should call the client-side
controller method by clicking on a button of a component
greet.cmp
<div>
<lightning:button labels=”You look nice today”
onClick =”-----------”/>
</div>
greet.js
{
handleClick : function(comp,event,helper){
alert(‘Welcome’);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick}
104) Which of following API is based on REST principles and is optimized for working with
larger sets of data?
a) Bulk Api
b) SOAP Api
c) Streaming Api
d) None of the above
105) To start the batch processing, we have to use which of the following method?
a) Database
b) Database.executeBatch
c) Database
d) Database
106) Which of the following annotation you will add to your method to expose it as a REST
Resource that can be called by an HTTP GET request?
a) “@”HttpPost
b) “@”HttpGet
c) “@”HttpPut
d) “@”HttpDelete
108) Which are three methods of Heroku and Salesforce Integration? (Select 3)
a) Heroku Connect.
b) Salesforce SOAP APIs.
c) Salesforce REST APIs
d) Callouts.
e) Canvas.
109) Suggest an attribute to a developer to declare that the component handles the event
after changes in the record (NOT SURE first marked c)
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanges
110) Below given is the controller code for a component. How would a component use this
controller? Select the appropriate option.
Public with sharing class ExpenseController{
//Some code here…
}
a) <aura:component standardController=’ExpenseController’>
b) <aura:component controller=’ExpenseController’>
c) <aura:component implements=’ExpenseController’>
d) <aura:component class=’ExpenseController’>
113) When making a callout from a method, the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true) or use Queueable Apex
b) Place the callout method in an asynchronous method that is annotated with
@future
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true)
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true)
117) Consider the following code. Select appropriate statement to print the value of
message attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a) {v.message}
b) {! message}
c) {message}
d) {!v.message}
118) Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
119) Which access specifier you will use for a class and methods to publish them as
SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
120) Select the form-based component from the following which can be used to display
records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm
SFDC TRAILHEAD QUIZ+Extra Questions
Q.1 which method causes the entire set of operations to be rolled back
a)error()
b)showError()
c)isError()
d)addError()
Q.2 Which Method you will use to declare a method as test method?
a)’@isTest’
b) ’@future’
c) ’@Rest’
d) ’@TestMethod’
Q.3 A developer would like to bypass the total number of records retrieved by SOQL
queries in the start Method.Which class object you would suggest to use?
a)Database.QueryLocator
b)Iteratable
c) Database.QueryRecords
d) Database.Iterable
Q.4 select three different flavours of asynchronous apex ?
a)Batch Apex
b)Future Method
c) Background Queueable
d)Scheduled Apex
Q.5 A developer like to Monitor the progress of future jobs. Suggest the correct way.
a)From Setup ,select Apex Jobs
b) Query ConTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query ConJobDetail to find future job
Q.6 Which Annotation will be used to expose an Apex class as Rest resource?
a) ‘@’RestResource
b) ‘@’ResourceRest
c) ‘@’HttpResource
d) ‘@’RestHttp
Q.7 When making a callout from a method ,the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future.
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true).
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true).
When making a callout from a method, the method waits for the external service to send
back the callout response before executing subsequent lines of code. Alternatively, you can
place the callout code in an asynchronous method that’s annotated
with @future(callout=true) or use Queueable Apex. This way, the callout runs on a separate
thread, and the execution of the calling method isn’t blocked.
Q.8 select the second generation of event products related to streaming API (select 2)
a) Change Data Capture
b) Push Topic Events
c)Generic streaming events
d)Platform events
Q.9 Which are the three methods of Heroku and Salesforce Integration(Select 3)
a) Heroku Connect
b) Salesforce SOAP API’S
c) Callout
d) Canvas
Q.12 What type of jobs do not show up in the Apex Flex Queue?
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
Q.15 A component has an attribute message . Select line appropriate statement to set
the value of message from client-controller method with newMessage.
handleClick2: function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2: Message:” + newMessage);
// Add correct statement below
---------------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
Q.16 Suggest an attribute to a developer to declare that the component handles the
event after changes in the record.
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanged
Q.17 Which attributes of force:recordData is set to localized error message if an error
occurs on loading a component?
a) targetFields
b) targetError
c) error
d) fieldsError
Q.20 A developer called a web services from an apex code which response status code
she should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
When the server processes the request, it sends a status code in the response. The status
code indicates whether the request was processed successfully or whether errors were
encountered. If the request is successful, the server sends a status code of 200. You’ve
probably seen some other status codes, such as 404 for file not found or 500 for an internal
server error.
Q.23 Select the inappropriate reason from the following to integrate apps on Heroku
with salesforce:
a) Data Replication
b) Data Proxies
c) Data Security
d) Custom User Interface
Q.24 Consider the following code. Select appropriate statement to print the value of
message
attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a. {v.message}
b. {! message}
c. {message}
d. {!v.message}
Q.25 Which of the following annotation you will add to your method to expose it as a
REST resource that can be called by an HTTP GET request?
a.) “@”HttpPost
b.)“@”HttpGet
c.) “@”HttpPut
d. )“@”HttpDelete
Q.26 Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
Request headers specify metadata for the request. The request body specifies data for the
request, when necessary. If there’s no data to specify, the body is omitted from the request.
36. Which of the following scenarios describes how you can use a connected app?
A.Users can create their own connected apps to access their personal email accounts.
B.Users can log in to an external application with their Salesforce or Experience Cloud
credentials.
C.Users can authorize a mobile app to securely access defined Salesforce data on their
behalf.
D.B and C
37. What's the difference between a connected app developer and a connected app
admin?
A.Only developers can set policies that explicitly define who can use connected apps and
where they can access the apps from.
B.Only admins can set policies that explicitly define who can use connected apps and
where they can access the apps from.
C.There isn't a difference between developers and admins when it comes to connected
apps.
D.Only developers use connected apps. Admins have no role with connected apps.
38. True or false: OAuth 2.0 APIs enable a user to work in one app but see the data
from another.
A.True
B.False
39. You're creating a connected app that allows a Smart TV to display a customer's
movie order history. Which OAuth 2.0 flow would you use for the connected app?
A.OAuth 2.0 web server flow
B.OAuth 2.0 device flow
C.OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
D.OAuth 2.0 user-agent flow
Using OpenID Connect dynamic client registration, resource servers can dynamically create
client apps as connected apps in Salesforce -- TRUE
When Salesforce acts as your identity provider, you can use a connected app to integrate
your service provider with your org. – FALSE
40. True or false: You can integrate identity providers with Salesforce using connected
apps.
A.True
B.False
41. How is OpenID Connect different from SAML?
A.You can't use OpenID Connect to enable SSO between two services.
B.You can only use OpenID Connect to enable SSO between two services.
C.OpenID Connect is built for today's API economy because it adds an authentication
layer on top of OAuth 2.0.
D.B and C
42. True or false: Dynamic client registration enables resource servers to dynamically
create client apps as connected apps.
A.True
B.False
43. What role does your Salesforce org play in providing authorization for external API
gateways?
A.My Salesforce org requests the creation of client apps as connected apps from the
external API gateway.
B.My Salesforce org hosts the protected data.
C.My Salesforce org is the OAuth authorization server that protects resources hosted on
an external API gateway.
D.My Salesforce org asks the external API gateway to authenticate a client app.
44. Which of the following is NOT an advantage of data replication over data proxies?
A.A replicated data set offloads processing and requests from an origin data server.
B.A replicated data set is always and immediately in sync with the origin data.
C.A replicated data set reduces data access latency.
D.A replicated data set supports bidirectional writes.
45. You can use Salesforce Connect to proxy which types of data sources:
A.OData 2.0 and 4.0
B.REST with JSON payloads
C.REST with XML payloads
D.SOAP
E.All of the above
46. Which technology do Salesforce REST APIs use for authentication?
A.Pre-shared keys
B.Basic usernames and passwords
C.OAuth
D.SAML
47. Callouts from Salesforce to Heroku can be made using:
A.Web sockets
B.Apex triggers or outbound messages
C.Message bus
D.Corba
56. The primary benefit of a workflow outbound message over an Apex trigger is:
A.The message can deliver the payload only as SOAP.
B.The message supports different authentication mechanisms.
C.Messages are completely declarative.
D.The message can handle every database event.
57. Callouts in Apex trigger support which authentication mechanisms:
A.Pre-shared keys
B.Username and password credentials
C.OAuth flows using named credentials in the Remote Site settings
D.All of the above
58. Heroku apps that handle callouts from Salesforce can be written in:
A.Node.js / JavaScript
B.Java, Scala, Clojure
C.Python
D.PHP
E.All of the above
• before insert
• before update
• before delete
• after insert
• after update
• after delete
• after undelete
• Before triggers are used to update or validate record values before they’re
saved to the database.
• After triggers are used to access field values that are set by the system (such
as a record's Id or LastModifiedDate field), and to affect changes in other
• records. The records that fire the after trigger are read-only.
62. What is a key benefit of asynchronous processing?
A.Higher governor and execution limits
B.Unlimited number of external callouts
C.Override organization-wide sharing defaults
D.Enabling turbo mode for transactional processing
63. Batch Apex is typically the best type of asynchronous processing when you want to:
A.Make a callout to a web service when a user updates a record.
B.Schedule a task to run on a weekly basis.
C.Update all records in your org.
D.Send a rickroll email to a contact.
Future Apex
Future methods are typically used for:
• Callouts to external Web services. If you are making callouts from a trigger or after
performing a DML operation, you must use a future or queueable method. A callout
in a trigger would hold the database connection open for the lifetime of the callout
and that is a "no-no" in a multitenant environment.
• Operations you want to run in their own thread, when time permits such as some sort
of resource-intensive calculation or processing of records.
• Isolating DML operations on different sObject types to prevent the mixed DML error.
This is somewhat of an edge-case but you may occasionally run across this issue.
See sObjects That Cannot Be Used Together in DML Operations for more details.
@future
@isTest
public class SMSCalloutMock implements HttpCalloutMock {
public HttpResponse respond(HttpRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"status":"success"}');
res.setStatusCode(200);
return res;
}
Batch Apex
Batch Apex is used to run large jobs (think thousands or millions of records!) that
would exceed normal processing limits. Using Batch Apex, you can process records
asynchronously in batches (hence the name, “Batch Apex”) to stay within platform
limits. If you have a lot of records to process, for example, data cleansing or
archiving, Batch Apex is probably your best solution.
start
Used to collect the records or objects to be passed to the interface method execute
for processing. This method is called once at the beginning of a Batch Apex job and
returns either a Database.QueryLocator object or an Iterable that contains the
records or objects passed to the job.
Most of the time a QueryLocator does the trick with a simple SOQL query to
generate the scope of objects in the batch job. But if you need to do something
crazy like loop through the results of an API call or pre-process records before being
passed to the execute method, you might want to check out the Custom Iterators
link in the Resources section.
With the QueryLocator object, the governor limit for the total number of records
retrieved by SOQL queries is bypassed and you can query up to 50 million records.
However, with an Iterable, the governor limit for the total number of records
retrieved by SOQL queries is still enforced.
execute
Performs the actual processing for each chunk or “batch” of data passed to the
method. The default batch size is 200 records. Batches of records are not guaranteed
to execute in the order they are received from the start method.
finish
Used to execute post-processing operations (for example, sending an email) and is called
once after all batches are processed.
}
public void finish(Database.BatchableContext bc){
Queueable Apex allows you to submit jobs for asynchronous processing similar to
future methods with the following additional benefits:
Queueable Syntax
To use Queueable Apex, simply implement the Queueable interface.
You can query AsyncApexJob to find your future job, but there’s a caveat. Since
kicking off a future job does not return an ID, you have to filter on some other field
such as MethodName, or JobType, to find your job. There are a few sample SOQL
queries in this Stack Exchange post that might help.
• Web service callouts to SOAP web services use XML, and typically require a WSDL
document for code generation.
• HTTP callouts to services typically use REST with JSON.
These two types of callouts are similar in terms of sending a request to a service and
receiving a response. But while WSDL-based callouts apply to SOAP Web services,
HTTP callouts can be used with any HTTP service, either SOAP or REST.
Some Common HTTP Methods
HTTP Method Description
GET Retrieve data identified by a URL.
POST Create a resource or post data to the server.
DELETE Delete a resource identified by a URL.
PUT Create or replace the resource sent in the request body.
RestResource Annotation
The @RestResource annotation is used at the class level and enables you to expose an
Apex class as a REST resource.
67.which of the following method is used to map the url pattern to RestResource
Annoatation
a)urlPattern
b)urlText
c)urlMap
d)urlMapping
68. Which of the following statements is true about creating apps with Visualforce:
A.Visualforce is designed primarily for page-centric web apps.
B.Visualforce renders the page on the server.
C.Visualforce will be fully supported by Salesforce for years to come.
D.All of the above.
69. Which of the following statements is NOT true about creating apps with Lightning
components:
A.Lightning components are designed primarily for app-centric web apps.
B.Lightning components can be used everywhere Visualforce can be used.
C.Lightning components render the page on the client.
D.All of the above.
70. Which of the following is a poor use of Lightning Components:
A.Developing an app for Salesforce1.
B.Developing a highly interactive app with an innovative user interface.
C.Developing widgets for use in Lightning App Builder.
D.None of the above. All of these are good use cases for Lightning Components.
73. Which of the following statements about Lightning Components and Lightning
Experience is true?
A.Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
B.Lightning Experience is (mostly) built with Lightning Components.
C.Lightning Experience uses an app-centric development model using Lightning
Components.
D.All of the above.
74. Which of the following is true of Aura Components:
A.Aura Components can only be used in the Lightning Experience and not the Salesforce
mobile app.
B.Aura Components can be used in Visualforce pages.
C.Aura Components are only optimized for the desktop experience.
D.All of the above.
75. Which of the following ISV features are available in Lightning Experience?
A.Trialforce.
B.Usage Metrics Visualization app.
C.Package creation.
D.None of the above are available.
76. As an ISV, which of the following is true about AppExchange:
A.Your apps undergo a review for Lightning Experience readiness.
B.Your apps are available to all customers, whether they have enabled Lightning
Experience or not.
C.The 'Lightning Ready' certification lets AppExchange visitors know your app is
verified for Lightning Experience.
D.All of the above.
77. Which of the following is true of Apex in the new Lightning Experience:
A.You have to update the API version for all your Apex classes in order for them to work
in Lightning Experience.
B.Apex is not supported in the new Lightning Experience.
C.Your Apex code and queries continue to function as before.
D.All of the above
78. What should you look for when reviewing your installed packages before using them
with Lightning Experience?
A.A 'Lightning Ready' sash for the package on AppExchange.
B.An error message saying the package isn't 'Lightning Ready'.
C.A 'Lightning Ready' check mark on the Installed Packages page.
D.Errors in the JavaScript console when using the package.
79. Which of the following descriptions about the Lightning Component framework is
true?
A.It's a UI framework for developing web apps for mobile and desktop devices.
B.It uses JavaScript on the client side and Apex on the server side.
C.It's a modern framework for building single-page applications.
D.All of the above
80. What can you build with the Lightning Component framework?
A.Standalone app
B.Components to use inside Visualforce pages
C.Drag-and-drop components for Lightning App Builder
D.All of the above
81. How is the Lightning Component framework different from other web app
frameworks?
A.It is optimized for both mobile and desktop experiences and proves it with Salesforce1
and Lightning Experience.
B.It connects natively with services provided by the Salesforce platform.
C.It has specific opinions about how data access is performed and has specific security
requirements.
D.All of the above
Aura Attribute
Expressions
Instead of getting lost in words again, let’s dive right into making helloMessage work
as intended.
<aura:component>
<aura:attribute name="message" type="String"/>
<p>Hello! {!v.message}</p>
</aura:component>
Copy
We’re outputting the contents of message using the expression {!v.message} . That is,
this expression references the message attribute. The expression is evaluated, and
resolves to the text string that’s currently stored in message . And that’s what the
expression outputs into the body of the component.
{!<expression>}
The formal definition of an expression is a bit intimidating, but let’s look at and then
unpack it: An expression is any set of literal values, variables, sub-expressions, or
operators that can be resolved to a single value.
Let’s look at the helloMessageInteractive controller in more detail, and make that
explanation a bit more concrete.
({
})
The force:recordData tag also supports a set of target * attributes, which are
attributes that force:recordData populates itself. The target * attributes can be used to
allow access from the UI.
89. Which tool you will use to add a Lightning Component on a Record Page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
90. A developer andrew would like to execute or run jobs sequentially. Suggest
which would be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
91. Which class contains the RestRequest and RestResponse objects in RESTful
webservices?
a) Resthttp
b) RestContent
c) RestContext
d) RestContainer
92.Which access specifier you will use for a class and methods to publish them
as SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
93. To start the batch processing we have to use which of the following
method?
a) Database.StartBatch
b) Database.executeBatch
c) Database.processBatch
d) Database.runBatch
94. Select the appropriate options to fill in the blanks which should call the
client-side controller method by clicking on a button of a component
Greet.cmp
<div>
<lightning button label = “You look nice today”
Onclick=”--------------------------”
</div>
Greet.js
{
handleClick : function(cmp,event,helper)
{
alert(“Welcome”);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick }
Ex:-
<aura:component>
<aura:attribute name="text" type="String" default="Just a string. Waiting
for change."/>
<input type="button" value="Flawed HTML Button"
onclick="alert('this will not work')"/>
<br/>
<lightning:button label="Framework Button" onclick="{!c.handleClick}"/>
<br/>
{!v.text}
</aura:component>
95. Select the form-based component from the following which can be used to
display records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm
96. Below given is the controller code for a component. Identify what is missing in the
code.
public with sharing class ExpensesController {
public static List<Expense_c> getExpenses() {
return [SELECT Id, Name, Amount_c, Client_c, Date_c,
Reimbursed_c, CreatedDate
FROM Expense_c];
}
}
a. “@”AuraEnabled annotation for getExpense() ✓
b. “@”AllowAccess annotation for getExpense()
c. “@”isTest annotation for getExpense()
d. “@”Aura annotation for getExpense()
When using force:recordData , load the data once and pass it to child components as
attributes. This approach reduces the number of listeners and minimizes server calls,
which improves performance and ensures that your components show consistent
data.
Loading Records
The first thing you do to make a record available for your UI components is to load it.
Load the record by including force:recordData in your component while specifying
the recordId , mode , and layoutType or fields attributes. Valid values
for layoutType are FULL and COMPACT .
ldsDisplayRecord.cmp
<force:recordData aura:id="record"
fields="Name,BillingCity,BillingState"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields ="{!v.simpleRecord}"
mode="VIEW"/>
Salesforce provides two SOAP API WSDLs for two different use cases. The enterprise WSDL is
optimized for a single Salesforce org. It’s strongly typed, and it reflects your org’s specific
configuration, meaning that two enterprise WSDL files generated from two different orgs
contain different information.
The partner WSDL is optimized for use with many Salesforce orgs. It’s loosely typed,
and it doesn’t change based on an org’s specific configuration. Typically, if you’re
writing an integration for a single Salesforce org, use the enterprise WSDL. For
several orgs, use the partner WSDL.
For this unit, we’re using the enterprise WSDL to explore SOAP API. The first step is
to generate a WSDL file for your org. In your Trailhead Playground, from Setup, enter
API in the Quick Find box, then select API. On the API WSDL page, click Generate
Enterprise WSDL.
On the Generate Enterprise WSDL page, click Generate. When the WSDL is
generated, right-click on the page and save the WSDL file somewhere on your
computer. We’ll be using it shortly.
Here’s a tip for working with the enterprise WSDL. The enterprise WSDL reflects your
org’s specific configuration, so whenever you make a metadata change to your org,
regenerate the WSDL file. This way, the WSDL file doesn’t fall out of sync with your
org’s configuration.
ENDD---------------------------------------------------------------------------------------------------
1) True or false: OAuth 2.0 APIs enable a user to work in one app but see the data from
another.
a) True
b) False
2) You're creating a connected app that allows a Smart TV to display a customer's movie order history.
Which OAuth 2.0 flow would you use for the connected app?
4) Batch Apex is typically the best type of asynchronous processing when you want to:
a) Make a callout to a web service when a user updates a record
6) Which declarative tool would you use for the following use case? Guide customers
a) Flow Builder
b) Approvals
c) Apex
7) Which declarative tool would you use for the following use case? When an opportunity's discount is
higher than 40%, notify the CEO via email and request sign-off. Provide a way for the CEO to leave
comments.
a) Flow Builder
b) Approvals
c) Apex
8) Which declarative tool would you use for the following use case? When the Annual Revenue field
exceeds $500,000 on an account, automatically update the Customer
a) Flow Builder
b) Approvals
c) Apex
11) What is the name of the framework that includes Aura components?
a) Lightning Components
b) Angular
c) jQuery
d) WebObjects
b) VisualForce
c) JavaScript
d) Objective-C
13) Which of the following descriptions about the Lightning Component framework is true?
a) It's a UI framework for developing web apps for mobile and desktop devices.
14) What can you build with the Lightning Component framework?
a) Standalone app
b) Components to use inside Visualforce pages
15) How is the Lightning Component framework different from other web app frameworks?
a) It is optimized for both mobile and desktop experiences and proves it with
c) It has specific opinions about how data access is performed and has specific
security requirements
d) All of the above
a) Fewer XHRS
b) Shared record data across components
18) What attributes are required when using force record Data to load a record when the
component loads?
a) recordid, mode, layout Type, fields
19) Which of the following is NOT an advantage of data replication over data proxies?
a) A replicated data set offloads processing and requests from an origin data
server
b) A replicated data set is always and immediately in sync with the origin
data
c) A replicated data set reduces data access latency d) A replicated data set supports bidirectional
writes..
20) You can use Salesforce Connect to proxy which types of data sources:
a) Pre-shared keys
b) Basic usernames and passwords
c) OAuth
d) SAML
a) Web sockets
c) Message bus
d) Corba
24) REST API is best suited for which of these use cases?
a) Loading lots of data into your org for the first time
b) Writing a mobile or web app
25) SOAP API is best suited for which of these use cases?
26) Bulk API is best suited for which of these use cases?
27) Streaming API is best suited for which of these use cases?
a) Notifying users whenever a record is deleted
b) Creating hundreds of account records at once
c) Writing an app where the use of XML is required
d) Using a WSDL file to specify the operations allowed on standard and custom
objects
28) What are all the factors that contribute to the total API limit calculation?
a) Org edition and API usage over the previous month
b) OAuth provides Heroku Connect with API tokens after the user authorizes the
d) The end user of a Heroku app authorizes Heroku Connect via OAuth.
31) Heroku Connect data replication happens:
c) Near real time for writes to Salesforce, and on a 30-second polling window for
writes to Heroku Postgres
d) Near real time for writes to Salesforce, and either on a polling window or near
real time for writes to Heroku Postgres (depending on the user configuration)
a) Cross-object relationships
b) Data paging
c) Search
d) All of the above
34) Which of the following is NOT an advantage of Salesforce Connect over ETL?
b) If the origin is offline, the data is still available via Salesforce Connect
c) Standard protocols like OData can easily proxy external data into Salesforce.
35) True or false: You can integrate identity providers with Salesforce using connected apps.
a) True
b) False
36) How is OpenID Connect different from SAML a) You can't use Openld Connect to enable SSO
between two services
b) You can only use Openld Connect to enable SSO between two services.
c) Openld Connect is built for today's API economy because it adds an authentication layer on top of
OAuth 20
d) B and C
37) Which of the following scenarios describes how you can use a connected app?
a) Users can create their own connected apps to access their personal email
accounts.
b) Users can log in to an external application with their Salesforce or Experience
Cloud credentials
c) Users can authorize a mobile app to securely access defined Salesforce data on
their behalf.
d) B and C
38) What's the difference between a connected app developer and a connected app admin?
a) Only developers can set policies that explicitly define who can use connected
apps and where they can access the apps from...
b) Only admins can set policies that explicitly define who can use connected apps
and where they can access the apps from
c) There isn't a difference between developers and admins when it comes connected apps I
to
d) Only developers use connected apps. Admins have no role with connected apps
39) What type of jobs do not show up in the Apex Flex Queue.
41) True or false: Dynamic client registration enables resource servers to dynamically create
client apps as connected apps.
a) True
b) False
42) What role does your Salesforce org play in providing authorization for external API
gateways?
a) My Salesforce org requests the creation of client apps as connected apps from
43) Which of the following ISV features are available in Lightning Experience?
a) Trialforce
b) Usage Metrics Visualization app.
c) Package creation.
d) None of the above are available.
45) Which of the following is true of Apex in the new Lightning Experience:
a) You have to update the API version for all your Apex classes in order for them to
46) What should you look for when reviewing your installed packages before using them with
Lightning Experience?
47) The primary benefit of a workflow outbound message over an Apex trigger is:
a) Pre-shared keys I
b) Username and password credentials
c) OAuth flows using named credentials in the Remote Site settings
49) Heroku apps that handle callouts from Salesforce can be written in:
c) Python
d) PHP
b) OAuth
c) Signed request
d) Either OAuth or signed request
51) You can build Canvas apps and run them on Heroku with of the following languages:
a) Node.js / JavaScript
c) Python
đ) PHP
53) Which of the following statements about Lightning Components and Lightning
Experience is true?
a) Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
b) Lightning Experience is (mostly) built with Lightning Components.
c) Lightning Experience uses an app-centric development model using Lightning
Components.
a) Aura Components can only be used in the Lightning Experience and not the Salesforce mobile app
55) Applications on Heroku that use Salesforce REST APIs can use which authentication
mechanisms.
a) Anonymous access without credentials on trusted networks
b) Username and password with an OAuth connected app
c) OAuth web or user-agent flow in which the user authorizes a connected app
using browser redirects
d) B and C
e) A and C
a) Platform events
b) Generic streaming events
c) Change data capture events
d) The event bus
59) Which replay option specifies that the subscriber receives event notifications with replay IDs 6, 7, 8,
and 9?
a) 6
b) 5
c) -2
d) -1
60) Which of the following SOQL query a valid pushtopic query? SELECT Name, Phone
61) What channel name corresponds to a platform event that you defined with the label of
a) /event/Solar_panel_Event
b) /topic/Solar_panel_Event
c) /event/Solar_panel_Event C
e) /event/Solar_ panel_Event_e
b) Create a Push Topic, and then POST a request to /Push Topic/<PushTopic/d>push c) POST a request to
/PushTopic/Push
63) Which of the following features of Visualforce do NOT work in Lightning Experience?
64) Which of the following is NOT true about the user interface and visual design in
Lightning Experience:
Which of the following statements is true about creating apps with visualforce:
a) Visualforce is designed primarily for page-centric web apps.
b) Visualforce renders the page on the server.
66) Which of the following statements is NOT true about creating apps with Lightning
components:
68) Which attribute of force:recordData is set to a localized error message if an error occurs
on loading a component?
a) targetFields
b) targetError
c) Error
d) fieldsError
69) My Domain is NOT required at the very beginning to develop with Lightning Components?
a) True
b) False
70) Which tool you will use to add a lightning component on a record page?
c) Form Builder
d) App Builder
71) Select the inappropriate reason from the following to integrate apps on Heroku with salesforce:
a) Data replication
b) Data proxies
c) Data Security
d) Custom user interfaces
72) Which are two types of SOAP API WSDLS provided by Salesforce? (Select 2)
a) Company WSDL
b) Enterprise WSDL
c) Partner WSDL
d) Person WSDL
74) Which type of app enables an external application to integrate with Salesforce using API
b) Service app
c) Connected app
d) External app
75) Which of the following statements is true about external gellouts: a) SOAP callouts use xml and may
use a wsdl for code generation.
b) HTTP callouts typically use JSON but can use XML as well.
c) HTTP callouts are generally easier to work with than SOAP callouts,
76) A developer, Andrew would like to execute or run jobs sequentially. Suggest which would
a) Queueable
b) Database Batchable
77) A developer would like to bypass the total number of records retrieved by SOQL queries in the start
method. Which class object you would suggest to use?
a) Database.QueryLocator
b) Iterable
c) Database QueryRecords
d) Database.Iterable
78) A developer want to send JSON data through a POST request in the web service. Which
a) Data-Type
b) Endpoint
c) Content-Type
d) body
a) Before undelete
b) After insert
c) Before update
d) After delete
80) Which annotation you will use to declare a method as test method?
a) "@isTest”
b) "@future
c) "@Rest
d) "@TestMethod"
81) Which class contains the RestRequest and RestResponse objects in RESTful
webservice?
a) RestHttp
b) RestContent
c) RestContext
d) RestContainer
82) Which of the following attribute is used to map the URL pattern to RestResource annotation?
a) urlPattern
b) urlText
c) uriMap
d) urlMapping
83) How many maximum number of Apex jobs we could schedule at one time?
a) 50
b) 100
c) 150
d) 200
84) Identify the correct apex class which allows to submit jobs for asynchronous processing
a) AsyncApex
b) Stateful
c) Batchable
d) Queueable
85) Select the second generation of event products related to streaming API. (Select 2)
d) Platform Events
86) A Developer, Brian, would like to create an optimized WSLD for use with many salesforce org. Which
type of WSDL should he create?
a) Company WSDL
b) Person WSDL
c) Enterprise WSDL
d) Partner WSDL
87) Identify the correct the attribute of force:recordData component which determines what operations
are available to perform with the record
a) Mode
b) recordID
c) Fields
d) LayoutType
a) UNDELETE
b) GET
c) POST
d) DELETE
e) PUT
89) A developer called a web service from an apex code. Which response status code she should check
to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
90) A developer is loading a record from the database using force recordData component. Which
attribute is populated with the loaded record?
a) tagetFields
b) targetRecord
c) targetError
d) targetRow
91) What should be the minimum code coverage % before deploying an apex code?
a) 71
b) 73
c) 75
d) 72
92) Select the inappropriate method from the following which informs the runtime that mock
b) Test setMock
c) Test Mock
d) Test startTest
93) To make a Lightning component available for any type of page, it must implement which interface?
a) flexipage:availableForAllPageTypes
b) flexipage availableForPageTypes
c) flexipage:availableForAllTypes
d) flexipage:ForAllPageTypes
94) Which annotation will be used to expose an apex class as REST resource?
a) “@”RestResource
b) "@"ResourceRest
c) "@HttpResource
d) "@"RestHttp
95) Which method causes the entire set of operations to be rolled back?
a) error()
b) showError()
c) isError()
d) addError()
96) To get a fresh set of governor limits in an apex test class, which method shall be used?
a) Test.runAs
b) Test.setMock
c) Test.startTest and Test stop Test
d) Test.assert
97) A developer like to monitor the progress of future jobs. Suggest the correct way.
a) From setup, select Apex Jobs
98) Below given is the controller code for a component. Identify what is missing in the code. Public with
sharing class ExpensesController( Public static List<Expense c> getExpenses(){
Return (SELECT Id, Name, Amount c, Client c, Date _c, Reimbursed c, CreatedDate
99) A component has an attribute message. Select the appropriate statement to set the value of
message from client-controller method with newMessage. handleClick2
function(component,event,helper){
a) component set("message",newMessage);
b) component.set("(!v.message)" newMessage);
c) component.set("v.message" newMessage);
d) component.get("v.message",newMessage);
100) A Developer, Amy, would like to create an optimized WSLD for a single salesforce
e) Company WSDL
1) Person WSDL
g) Enterprise WSDL
h) Partner WSDL
101) A Lightning component developer want to fetch data of a custom object Review_c from database
and want to display on a component. What type of controller should be used?
b) Extension Controller
c) Client-side Controller with Server-side Controller
d) Standard Controller
102) Identify the correct trigger variable which shows the currently executing code
in apex trigger.
a) isinsert
b) isExecuting
c) isAfter
d) isDelete
104) Which of following API is based on REST principles and is optimized for working with
a) Bulk Api
b) SOAP Api
c) Streaming Api
105) To start the batch processing, we have to use which of the following method?
a) Database
b) Database.executeBatch
c) Database
d) Database
106) Which of the following annotation you will add to your method to expose it as a REST Resource
that can be called by an HTTP GET request? I
a) "@HttpPost
b)”@” HttpGet
c) "@HttpPut
d) "@HttpDelete
107) Which of the following is NOT the use of future methods?
a) Callout to external Web Services
b) Isolating DML operations on different sObject types prevent mixed DML error
c) Override organization-wide sharing defaults
108) Which are three methods of Heroku and Salesforce Integration? (Select
a) Heroku Connect
b) Salesforce SOAP APIs.
c) Salesforce REST APIs
d) Callouts.
E)Canvas
109) Suggest an attribute to a developer to declare that the component handles the event
b) recordData
c) recordUpdated
d) recordChanges
110) Below given is the controller code for a component. How would a component use this controller?
Select the appropriate option. Public with sharing class ExpenseController{
b) <aura.component controller="ExpenseController'>
c) <aura:component implements=’ ExpenseController'>
d) <aura:component class='ExpenseController>
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future
c) Place the callout method in an asynchronous method that is annotated with @HttpGet(callout=true)
d) Place the callout method in an asynchronous method that is annotated with @HttpPost(callout=true)
SFDC TRAILHEAD QUIZ+Extra Questions
Q.1 which method causes the entire set of operations to be rolled back
a)error()
b)showError()
c)isError()
d)addError()
Q.2 Which Method you will use to declare a method as test method?
a)’@isTest’
b) ’@future’
c) ’@Rest’
d) ’@TestMethod’
Q.3 A developer would like to bypass the total number of records retrieved by SOQL
queries in the start Method.Which class object you would suggest to use?
a)Database.QueryLocator
b)Iteratable
c) Database.QueryRecords
d) Database.Iterable
Q.4 select three different flavours of asynchronous apex ?
a)Batch Apex
b)Future Method
c) Background Queueable
d)Scheduled Apex
Q.5 A developer like to Monitor the progress of future jobs. Suggest the correct way.
a)From Setup ,select Apex Jobs
b) Query ConTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query ConJobDetail to find future job
Q.6 Which Annotation will be used to expose an Apex class as Rest resource?
a) ‘@’RestResource
b) ‘@’ResourceRest
c) ‘@’HttpResource
d) ‘@’RestHttp
Q.7 When making a callout from a method ,the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future.
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true).
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true).
When making a callout from a method, the method waits for the external service to send
back the callout response before executing subsequent lines of code. Alternatively, you can
place the callout code in an asynchronous method that’s annotated
with @future(callout=true) or use Queueable Apex. This way, the callout runs on a separate
thread, and the execution of the calling method isn’t blocked.
Q.8 select the second generation of event products related to streaming API (select 2)
a) Change Data Capture
b) Push Topic Events
c)Generic streaming events
d)Platform events
Q.9 Which are the three methods of Heroku and Salesforce Integration(Select 3)
a) Heroku Connect
b) Salesforce SOAP API’S
c) Callout
d) Canvas
Q.12 What type of jobs do not show up in the Apex Flex Queue?
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
Q.15 A component has an attribute message . Select line appropriate statement to set
the value of message from client-controller method with newMessage.
handleClick2: function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2: Message:” + newMessage);
// Add correct statement below
---------------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
Q.16 Suggest an attribute to a developer to declare that the component handles the
event after changes in the record.
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanged
Q.17 Which attributes of force:recordData is set to localized error message if an error
occurs on loading a component?
a) targetFields
b) targetError
c) error
d) fieldsError
Q.20 A developer called a web services from an apex code which response status code
she should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
When the server processes the request, it sends a status code in the response. The status
code indicates whether the request was processed successfully or whether errors were
encountered. If the request is successful, the server sends a status code of 200. You’ve
probably seen some other status codes, such as 404 for file not found or 500 for an internal
server error.
Q.23 Select the inappropriate reason from the following to integrate apps on Heroku
with salesforce:
a) Data Replication
b) Data Proxies
c) Data Security
d) Custom User Interface
Q.24 Consider the following code. Select appropriate statement to print the value of
message
attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a. {v.message}
b. {! message}
c. {message}
d. {!v.message}
Q.25 Which of the following annotation you will add to your method to expose it as a
REST resource that can be called by an HTTP GET request?
a.) “@”HttpPost
b.)“@”HttpGet
c.) “@”HttpPut
d. )“@”HttpDelete
Q.26 Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
Request headers specify metadata for the request. The request body specifies data for the
request, when necessary. If there’s no data to specify, the body is omitted from the request.
36. Which of the following scenarios describes how you can use a connected app?
A.Users can create their own connected apps to access their personal email accounts.
B.Users can log in to an external application with their Salesforce or Experience Cloud
credentials.
C.Users can authorize a mobile app to securely access defined Salesforce data on their
behalf.
D.B and C
37. What's the difference between a connected app developer and a connected app
admin?
A.Only developers can set policies that explicitly define who can use connected apps and
where they can access the apps from.
B.Only admins can set policies that explicitly define who can use connected apps and
where they can access the apps from.
C.There isn't a difference between developers and admins when it comes to connected
apps.
D.Only developers use connected apps. Admins have no role with connected apps.
38. True or false: OAuth 2.0 APIs enable a user to work in one app but see the data
from another.
A.True
B.False
39. You're creating a connected app that allows a Smart TV to display a customer's
movie order history. Which OAuth 2.0 flow would you use for the connected app?
A.OAuth 2.0 web server flow
B.OAuth 2.0 device flow
C.OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
D.OAuth 2.0 user-agent flow
Using OpenID Connect dynamic client registration, resource servers can dynamically create
client apps as connected apps in Salesforce -- TRUE
When Salesforce acts as your identity provider, you can use a connected app to integrate
your service provider with your org. – FALSE
40. True or false: You can integrate identity providers with Salesforce using connected
apps.
A.True
B.False
41. How is OpenID Connect different from SAML?
A.You can't use OpenID Connect to enable SSO between two services.
B.You can only use OpenID Connect to enable SSO between two services.
C.OpenID Connect is built for today's API economy because it adds an authentication
layer on top of OAuth 2.0.
D.B and C
42. True or false: Dynamic client registration enables resource servers to dynamically
create client apps as connected apps.
A.True
B.False
43. What role does your Salesforce org play in providing authorization for external API
gateways?
A.My Salesforce org requests the creation of client apps as connected apps from the
external API gateway.
B.My Salesforce org hosts the protected data.
C.My Salesforce org is the OAuth authorization server that protects resources hosted on
an external API gateway.
D.My Salesforce org asks the external API gateway to authenticate a client app.
44. Which of the following is NOT an advantage of data replication over data proxies?
A.A replicated data set offloads processing and requests from an origin data server.
B.A replicated data set is always and immediately in sync with the origin data.
C.A replicated data set reduces data access latency.
D.A replicated data set supports bidirectional writes.
45. You can use Salesforce Connect to proxy which types of data sources:
A.OData 2.0 and 4.0
B.REST with JSON payloads
C.REST with XML payloads
D.SOAP
E.All of the above
46. Which technology do Salesforce REST APIs use for authentication?
A.Pre-shared keys
B.Basic usernames and passwords
C.OAuth
D.SAML
47. Callouts from Salesforce to Heroku can be made using:
A.Web sockets
B.Apex triggers or outbound messages
C.Message bus
D.Corba
56. The primary benefit of a workflow outbound message over an Apex trigger is:
A.The message can deliver the payload only as SOAP.
B.The message supports different authentication mechanisms.
C.Messages are completely declarative.
D.The message can handle every database event.
57. Callouts in Apex trigger support which authentication mechanisms:
A.Pre-shared keys
B.Username and password credentials
C.OAuth flows using named credentials in the Remote Site settings
D.All of the above
58. Heroku apps that handle callouts from Salesforce can be written in:
A.Node.js / JavaScript
B.Java, Scala, Clojure
C.Python
D.PHP
E.All of the above
• before insert
• before update
• before delete
• after insert
• after update
• after delete
• after undelete
• Before triggers are used to update or validate record values before they’re
saved to the database.
• After triggers are used to access field values that are set by the system (such
as a record's Id or LastModifiedDate field), and to affect changes in other
• records. The records that fire the after trigger are read-only.
62. What is a key benefit of asynchronous processing?
A.Higher governor and execution limits
B.Unlimited number of external callouts
C.Override organization-wide sharing defaults
D.Enabling turbo mode for transactional processing
63. Batch Apex is typically the best type of asynchronous processing when you want to:
A.Make a callout to a web service when a user updates a record.
B.Schedule a task to run on a weekly basis.
C.Update all records in your org.
D.Send a rickroll email to a contact.
Future Apex
Future methods are typically used for:
• Callouts to external Web services. If you are making callouts from a trigger or after
performing a DML operation, you must use a future or queueable method. A callout
in a trigger would hold the database connection open for the lifetime of the callout
and that is a "no-no" in a multitenant environment.
• Operations you want to run in their own thread, when time permits such as some sort
of resource-intensive calculation or processing of records.
• Isolating DML operations on different sObject types to prevent the mixed DML error.
This is somewhat of an edge-case but you may occasionally run across this issue.
See sObjects That Cannot Be Used Together in DML Operations for more details.
@future
@isTest
public class SMSCalloutMock implements HttpCalloutMock {
public HttpResponse respond(HttpRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"status":"success"}');
res.setStatusCode(200);
return res;
}
Batch Apex
Batch Apex is used to run large jobs (think thousands or millions of records!) that
would exceed normal processing limits. Using Batch Apex, you can process records
asynchronously in batches (hence the name, “Batch Apex”) to stay within platform
limits. If you have a lot of records to process, for example, data cleansing or
archiving, Batch Apex is probably your best solution.
start
Used to collect the records or objects to be passed to the interface method execute
for processing. This method is called once at the beginning of a Batch Apex job and
returns either a Database.QueryLocator object or an Iterable that contains the
records or objects passed to the job.
Most of the time a QueryLocator does the trick with a simple SOQL query to
generate the scope of objects in the batch job. But if you need to do something
crazy like loop through the results of an API call or pre-process records before being
passed to the execute method, you might want to check out the Custom Iterators
link in the Resources section.
With the QueryLocator object, the governor limit for the total number of records
retrieved by SOQL queries is bypassed and you can query up to 50 million records.
However, with an Iterable, the governor limit for the total number of records
retrieved by SOQL queries is still enforced.
execute
Performs the actual processing for each chunk or “batch” of data passed to the
method. The default batch size is 200 records. Batches of records are not guaranteed
to execute in the order they are received from the start method.
finish
Used to execute post-processing operations (for example, sending an email) and is called
once after all batches are processed.
}
public void finish(Database.BatchableContext bc){
Queueable Apex allows you to submit jobs for asynchronous processing similar to
future methods with the following additional benefits:
Queueable Syntax
To use Queueable Apex, simply implement the Queueable interface.
You can query AsyncApexJob to find your future job, but there’s a caveat. Since
kicking off a future job does not return an ID, you have to filter on some other field
such as MethodName, or JobType, to find your job. There are a few sample SOQL
queries in this Stack Exchange post that might help.
• Web service callouts to SOAP web services use XML, and typically require a WSDL
document for code generation.
• HTTP callouts to services typically use REST with JSON.
These two types of callouts are similar in terms of sending a request to a service and
receiving a response. But while WSDL-based callouts apply to SOAP Web services,
HTTP callouts can be used with any HTTP service, either SOAP or REST.
Some Common HTTP Methods
HTTP Method Description
GET Retrieve data identified by a URL.
POST Create a resource or post data to the server.
DELETE Delete a resource identified by a URL.
PUT Create or replace the resource sent in the request body.
RestResource Annotation
The @RestResource annotation is used at the class level and enables you to expose an
Apex class as a REST resource.
67.which of the following method is used to map the url pattern to RestResource
Annoatation
a)urlPattern
b)urlText
c)urlMap
d)urlMapping
68. Which of the following statements is true about creating apps with Visualforce:
A.Visualforce is designed primarily for page-centric web apps.
B.Visualforce renders the page on the server.
C.Visualforce will be fully supported by Salesforce for years to come.
D.All of the above.
69. Which of the following statements is NOT true about creating apps with Lightning
components:
A.Lightning components are designed primarily for app-centric web apps.
B.Lightning components can be used everywhere Visualforce can be used.
C.Lightning components render the page on the client.
D.All of the above.
70. Which of the following is a poor use of Lightning Components:
A.Developing an app for Salesforce1.
B.Developing a highly interactive app with an innovative user interface.
C.Developing widgets for use in Lightning App Builder.
D.None of the above. All of these are good use cases for Lightning Components.
73. Which of the following statements about Lightning Components and Lightning
Experience is true?
A.Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
B.Lightning Experience is (mostly) built with Lightning Components.
C.Lightning Experience uses an app-centric development model using Lightning
Components.
D.All of the above.
74. Which of the following is true of Aura Components:
A.Aura Components can only be used in the Lightning Experience and not the Salesforce
mobile app.
B.Aura Components can be used in Visualforce pages.
C.Aura Components are only optimized for the desktop experience.
D.All of the above.
75. Which of the following ISV features are available in Lightning Experience?
A.Trialforce.
B.Usage Metrics Visualization app.
C.Package creation.
D.None of the above are available.
76. As an ISV, which of the following is true about AppExchange:
A.Your apps undergo a review for Lightning Experience readiness.
B.Your apps are available to all customers, whether they have enabled Lightning
Experience or not.
C.The 'Lightning Ready' certification lets AppExchange visitors know your app is
verified for Lightning Experience.
D.All of the above.
77. Which of the following is true of Apex in the new Lightning Experience:
A.You have to update the API version for all your Apex classes in order for them to work
in Lightning Experience.
B.Apex is not supported in the new Lightning Experience.
C.Your Apex code and queries continue to function as before.
D.All of the above
78. What should you look for when reviewing your installed packages before using them
with Lightning Experience?
A.A 'Lightning Ready' sash for the package on AppExchange.
B.An error message saying the package isn't 'Lightning Ready'.
C.A 'Lightning Ready' check mark on the Installed Packages page.
D.Errors in the JavaScript console when using the package.
79. Which of the following descriptions about the Lightning Component framework is
true?
A.It's a UI framework for developing web apps for mobile and desktop devices.
B.It uses JavaScript on the client side and Apex on the server side.
C.It's a modern framework for building single-page applications.
D.All of the above
80. What can you build with the Lightning Component framework?
A.Standalone app
B.Components to use inside Visualforce pages
C.Drag-and-drop components for Lightning App Builder
D.All of the above
81. How is the Lightning Component framework different from other web app
frameworks?
A.It is optimized for both mobile and desktop experiences and proves it with Salesforce1
and Lightning Experience.
B.It connects natively with services provided by the Salesforce platform.
C.It has specific opinions about how data access is performed and has specific security
requirements.
D.All of the above
Aura Attribute
Expressions
Instead of getting lost in words again, let’s dive right into making helloMessage work
as intended.
<aura:component>
<aura:attribute name="message" type="String"/>
<p>Hello! {!v.message}</p>
</aura:component>
Copy
We’re outputting the contents of message using the expression {!v.message} . That is,
this expression references the message attribute. The expression is evaluated, and
resolves to the text string that’s currently stored in message . And that’s what the
expression outputs into the body of the component.
{!<expression>}
The formal definition of an expression is a bit intimidating, but let’s look at and then
unpack it: An expression is any set of literal values, variables, sub-expressions, or
operators that can be resolved to a single value.
Let’s look at the helloMessageInteractive controller in more detail, and make that
explanation a bit more concrete.
({
})
The force:recordData tag also supports a set of target * attributes, which are
attributes that force:recordData populates itself. The target * attributes can be used to
allow access from the UI.
89. Which tool you will use to add a Lightning Component on a Record Page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
90. A developer andrew would like to execute or run jobs sequentially. Suggest
which would be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
91. Which class contains the RestRequest and RestResponse objects in RESTful
webservices?
a) Resthttp
b) RestContent
c) RestContext
d) RestContainer
92.Which access specifier you will use for a class and methods to publish them
as SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
93. To start the batch processing we have to use which of the following
method?
a) Database.StartBatch
b) Database.executeBatch
c) Database.processBatch
d) Database.runBatch
94. Select the appropriate options to fill in the blanks which should call the
client-side controller method by clicking on a button of a component
Greet.cmp
<div>
<lightning button label = “You look nice today”
Onclick=”--------------------------”
</div>
Greet.js
{
handleClick : function(cmp,event,helper)
{
alert(“Welcome”);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick }
Ex:-
<aura:component>
<aura:attribute name="text" type="String" default="Just a string. Waiting
for change."/>
<input type="button" value="Flawed HTML Button"
onclick="alert('this will not work')"/>
<br/>
<lightning:button label="Framework Button" onclick="{!c.handleClick}"/>
<br/>
{!v.text}
</aura:component>
95. Select the form-based component from the following which can be used to
display records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm
96. Below given is the controller code for a component. Identify what is missing in the
code.
public with sharing class ExpensesController {
public static List<Expense_c> getExpenses() {
return [SELECT Id, Name, Amount_c, Client_c, Date_c,
Reimbursed_c, CreatedDate
FROM Expense_c];
}
}
a. “@”AuraEnabled annotation for getExpense() ✓
b. “@”AllowAccess annotation for getExpense()
c. “@”isTest annotation for getExpense()
d. “@”Aura annotation for getExpense()
When using force:recordData , load the data once and pass it to child components as
attributes. This approach reduces the number of listeners and minimizes server calls,
which improves performance and ensures that your components show consistent
data.
Loading Records
The first thing you do to make a record available for your UI components is to load it.
Load the record by including force:recordData in your component while specifying
the recordId , mode , and layoutType or fields attributes. Valid values
for layoutType are FULL and COMPACT .
ldsDisplayRecord.cmp
<force:recordData aura:id="record"
fields="Name,BillingCity,BillingState"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields ="{!v.simpleRecord}"
mode="VIEW"/>
Salesforce provides two SOAP API WSDLs for two different use cases. The enterprise WSDL is
optimized for a single Salesforce org. It’s strongly typed, and it reflects your org’s specific
configuration, meaning that two enterprise WSDL files generated from two different orgs
contain different information.
The partner WSDL is optimized for use with many Salesforce orgs. It’s loosely typed,
and it doesn’t change based on an org’s specific configuration. Typically, if you’re
writing an integration for a single Salesforce org, use the enterprise WSDL. For
several orgs, use the partner WSDL.
For this unit, we’re using the enterprise WSDL to explore SOAP API. The first step is
to generate a WSDL file for your org. In your Trailhead Playground, from Setup, enter
API in the Quick Find box, then select API. On the API WSDL page, click Generate
Enterprise WSDL.
On the Generate Enterprise WSDL page, click Generate. When the WSDL is
generated, right-click on the page and save the WSDL file somewhere on your
computer. We’ll be using it shortly.
Here’s a tip for working with the enterprise WSDL. The enterprise WSDL reflects your
org’s specific configuration, so whenever you make a metadata change to your org,
regenerate the WSDL file. This way, the WSDL file doesn’t fall out of sync with your
org’s configuration.
ENDD---------------------------------------------------------------------------------------------------
SFDC TRAILHEAD QUIZ+Extra Questions
Q.1 which method causes the entire set of operations to be rolled back
a)error()
b)showError()
c)isError()
d)addError()
Q.2 Which Method you will use to declare a method as test method?
a)’@isTest’
b) ’@future’
c) ’@Rest’
d) ’@TestMethod’
Q.3 A developer would like to bypass the total number of records retrieved by SOQL
queries in the start Method.Which class object you would suggest to use?
a)Database.QueryLocator
b)Iteratable
c) Database.QueryRecords
d) Database.Iterable
Q.4 select three different flavours of asynchronous apex ?
a)Batch Apex
b)Future Method
c) Background Queueable
d)Scheduled Apex
Q.5 A developer like to Monitor the progress of future jobs. Suggest the correct way.
a)From Setup ,select Apex Jobs
b) Query ConTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query ConJobDetail to find future job
Q.6 Which Annotation will be used to expose an Apex class as Rest resource?
a) ‘@’RestResource
b) ‘@’ResourceRest
c) ‘@’HttpResource
d) ‘@’RestHttp
Q.7 When making a callout from a method ,the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future.
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true).
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true).
When making a callout from a method, the method waits for the external service to send
back the callout response before executing subsequent lines of code. Alternatively, you can
place the callout code in an asynchronous method that’s annotated
with @future(callout=true) or use Queueable Apex. This way, the callout runs on a separate
thread, and the execution of the calling method isn’t blocked.
Q.8 select the second generation of event products related to streaming API (select 2)
a) Change Data Capture
b) Push Topic Events
c)Generic streaming events
d)Platform events
Q.9 Which are the three methods of Heroku and Salesforce Integration(Select 3)
a) Heroku Connect
b) Salesforce SOAP API’S
c) Callout
d) Canvas
Q.12 What type of jobs do not show up in the Apex Flex Queue?
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
Q.15 A component has an attribute message . Select line appropriate statement to set
the value of message from client-controller method with newMessage.
handleClick2: function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2: Message:” + newMessage);
// Add correct statement below
---------------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
Q.16 Suggest an attribute to a developer to declare that the component handles the
event after changes in the record.
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanged
Q.17 Which attributes of force:recordData is set to localized error message if an error
occurs on loading a component?
a) targetFields
b) targetError
c) error
d) fieldsError
Q.20 A developer called a web services from an apex code which response status code
she should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
When the server processes the request, it sends a status code in the response. The status
code indicates whether the request was processed successfully or whether errors were
encountered. If the request is successful, the server sends a status code of 200. You’ve
probably seen some other status codes, such as 404 for file not found or 500 for an internal
server error.
Q.23 Select the inappropriate reason from the following to integrate apps on Heroku
with salesforce:
a) Data Replication
b) Data Proxies
c) Data Security
d) Custom User Interface
Q.24 Consider the following code. Select appropriate statement to print the value of
message
attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a. {v.message}
b. {! message}
c. {message}
d. {!v.message}
Q.25 Which of the following annotation you will add to your method to expose it as a
REST resource that can be called by an HTTP GET request?
a.) “@”HttpPost
b.)“@”HttpGet
c.) “@”HttpPut
d. )“@”HttpDelete
Q.26 Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
Request headers specify metadata for the request. The request body specifies data for the
request, when necessary. If there’s no data to specify, the body is omitted from the request.
36. Which of the following scenarios describes how you can use a connected app?
A.Users can create their own connected apps to access their personal email accounts.
B.Users can log in to an external application with their Salesforce or Experience Cloud
credentials.
C.Users can authorize a mobile app to securely access defined Salesforce data on their
behalf.
D.B and C
37. What's the difference between a connected app developer and a connected app
admin?
A.Only developers can set policies that explicitly define who can use connected apps and
where they can access the apps from.
B.Only admins can set policies that explicitly define who can use connected apps and
where they can access the apps from.
C.There isn't a difference between developers and admins when it comes to connected
apps.
D.Only developers use connected apps. Admins have no role with connected apps.
38. True or false: OAuth 2.0 APIs enable a user to work in one app but see the data
from another.
A.True
B.False
39. You're creating a connected app that allows a Smart TV to display a customer's
movie order history. Which OAuth 2.0 flow would you use for the connected app?
A.OAuth 2.0 web server flow
B.OAuth 2.0 device flow
C.OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
D.OAuth 2.0 user-agent flow
Using OpenID Connect dynamic client registration, resource servers can dynamically create
client apps as connected apps in Salesforce -- TRUE
When Salesforce acts as your identity provider, you can use a connected app to integrate
your service provider with your org. – FALSE
40. True or false: You can integrate identity providers with Salesforce using connected
apps.
A.True
B.False
41. How is OpenID Connect different from SAML?
A.You can't use OpenID Connect to enable SSO between two services.
B.You can only use OpenID Connect to enable SSO between two services.
C.OpenID Connect is built for today's API economy because it adds an authentication
layer on top of OAuth 2.0.
D.B and C
42. True or false: Dynamic client registration enables resource servers to dynamically
create client apps as connected apps.
A.True
B.False
43. What role does your Salesforce org play in providing authorization for external API
gateways?
A.My Salesforce org requests the creation of client apps as connected apps from the
external API gateway.
B.My Salesforce org hosts the protected data.
C.My Salesforce org is the OAuth authorization server that protects resources hosted on
an external API gateway.
D.My Salesforce org asks the external API gateway to authenticate a client app.
44. Which of the following is NOT an advantage of data replication over data proxies?
A.A replicated data set offloads processing and requests from an origin data server.
B.A replicated data set is always and immediately in sync with the origin data.
C.A replicated data set reduces data access latency.
D.A replicated data set supports bidirectional writes.
45. You can use Salesforce Connect to proxy which types of data sources:
A.OData 2.0 and 4.0
B.REST with JSON payloads
C.REST with XML payloads
D.SOAP
E.All of the above
46. Which technology do Salesforce REST APIs use for authentication?
A.Pre-shared keys
B.Basic usernames and passwords
C.OAuth
D.SAML
47. Callouts from Salesforce to Heroku can be made using:
A.Web sockets
B.Apex triggers or outbound messages
C.Message bus
D.Corba
56. The primary benefit of a workflow outbound message over an Apex trigger is:
A.The message can deliver the payload only as SOAP.
B.The message supports different authentication mechanisms.
C.Messages are completely declarative.
D.The message can handle every database event.
57. Callouts in Apex trigger support which authentication mechanisms:
A.Pre-shared keys
B.Username and password credentials
C.OAuth flows using named credentials in the Remote Site settings
D.All of the above
58. Heroku apps that handle callouts from Salesforce can be written in:
A.Node.js / JavaScript
B.Java, Scala, Clojure
C.Python
D.PHP
E.All of the above
• before insert
• before update
• before delete
• after insert
• after update
• after delete
• after undelete
• Before triggers are used to update or validate record values before they’re
saved to the database.
• After triggers are used to access field values that are set by the system (such
as a record's Id or LastModifiedDate field), and to affect changes in other
• records. The records that fire the after trigger are read-only.
62. What is a key benefit of asynchronous processing?
A.Higher governor and execution limits
B.Unlimited number of external callouts
C.Override organization-wide sharing defaults
D.Enabling turbo mode for transactional processing
63. Batch Apex is typically the best type of asynchronous processing when you want to:
A.Make a callout to a web service when a user updates a record.
B.Schedule a task to run on a weekly basis.
C.Update all records in your org.
D.Send a rickroll email to a contact.
Future Apex
Future methods are typically used for:
• Callouts to external Web services. If you are making callouts from a trigger or after
performing a DML operation, you must use a future or queueable method. A callout
in a trigger would hold the database connection open for the lifetime of the callout
and that is a "no-no" in a multitenant environment.
• Operations you want to run in their own thread, when time permits such as some sort
of resource-intensive calculation or processing of records.
• Isolating DML operations on different sObject types to prevent the mixed DML error.
This is somewhat of an edge-case but you may occasionally run across this issue.
See sObjects That Cannot Be Used Together in DML Operations for more details.
@future
@isTest
public class SMSCalloutMock implements HttpCalloutMock {
public HttpResponse respond(HttpRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"status":"success"}');
res.setStatusCode(200);
return res;
}
Batch Apex
Batch Apex is used to run large jobs (think thousands or millions of records!) that
would exceed normal processing limits. Using Batch Apex, you can process records
asynchronously in batches (hence the name, “Batch Apex”) to stay within platform
limits. If you have a lot of records to process, for example, data cleansing or
archiving, Batch Apex is probably your best solution.
start
Used to collect the records or objects to be passed to the interface method execute
for processing. This method is called once at the beginning of a Batch Apex job and
returns either a Database.QueryLocator object or an Iterable that contains the
records or objects passed to the job.
Most of the time a QueryLocator does the trick with a simple SOQL query to
generate the scope of objects in the batch job. But if you need to do something
crazy like loop through the results of an API call or pre-process records before being
passed to the execute method, you might want to check out the Custom Iterators
link in the Resources section.
With the QueryLocator object, the governor limit for the total number of records
retrieved by SOQL queries is bypassed and you can query up to 50 million records.
However, with an Iterable, the governor limit for the total number of records
retrieved by SOQL queries is still enforced.
execute
Performs the actual processing for each chunk or “batch” of data passed to the
method. The default batch size is 200 records. Batches of records are not guaranteed
to execute in the order they are received from the start method.
finish
Used to execute post-processing operations (for example, sending an email) and is called
once after all batches are processed.
}
public void finish(Database.BatchableContext bc){
Queueable Apex allows you to submit jobs for asynchronous processing similar to
future methods with the following additional benefits:
Queueable Syntax
To use Queueable Apex, simply implement the Queueable interface.
You can query AsyncApexJob to find your future job, but there’s a caveat. Since
kicking off a future job does not return an ID, you have to filter on some other field
such as MethodName, or JobType, to find your job. There are a few sample SOQL
queries in this Stack Exchange post that might help.
• Web service callouts to SOAP web services use XML, and typically require a WSDL
document for code generation.
• HTTP callouts to services typically use REST with JSON.
These two types of callouts are similar in terms of sending a request to a service and
receiving a response. But while WSDL-based callouts apply to SOAP Web services,
HTTP callouts can be used with any HTTP service, either SOAP or REST.
Some Common HTTP Methods
HTTP Method Description
GET Retrieve data identified by a URL.
POST Create a resource or post data to the server.
DELETE Delete a resource identified by a URL.
PUT Create or replace the resource sent in the request body.
RestResource Annotation
The @RestResource annotation is used at the class level and enables you to expose an
Apex class as a REST resource.
67.which of the following method is used to map the url pattern to RestResource
Annoatation
a)urlPattern
b)urlText
c)urlMap
d)urlMapping
68. Which of the following statements is true about creating apps with Visualforce:
A.Visualforce is designed primarily for page-centric web apps.
B.Visualforce renders the page on the server.
C.Visualforce will be fully supported by Salesforce for years to come.
D.All of the above.
69. Which of the following statements is NOT true about creating apps with Lightning
components:
A.Lightning components are designed primarily for app-centric web apps.
B.Lightning components can be used everywhere Visualforce can be used.
C.Lightning components render the page on the client.
D.All of the above.
70. Which of the following is a poor use of Lightning Components:
A.Developing an app for Salesforce1.
B.Developing a highly interactive app with an innovative user interface.
C.Developing widgets for use in Lightning App Builder.
D.None of the above. All of these are good use cases for Lightning Components.
73. Which of the following statements about Lightning Components and Lightning
Experience is true?
A.Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
B.Lightning Experience is (mostly) built with Lightning Components.
C.Lightning Experience uses an app-centric development model using Lightning
Components.
D.All of the above.
74. Which of the following is true of Aura Components:
A.Aura Components can only be used in the Lightning Experience and not the Salesforce
mobile app.
B.Aura Components can be used in Visualforce pages.
C.Aura Components are only optimized for the desktop experience.
D.All of the above.
75. Which of the following ISV features are available in Lightning Experience?
A.Trialforce.
B.Usage Metrics Visualization app.
C.Package creation.
D.None of the above are available.
76. As an ISV, which of the following is true about AppExchange:
A.Your apps undergo a review for Lightning Experience readiness.
B.Your apps are available to all customers, whether they have enabled Lightning
Experience or not.
C.The 'Lightning Ready' certification lets AppExchange visitors know your app is
verified for Lightning Experience.
D.All of the above.
77. Which of the following is true of Apex in the new Lightning Experience:
A.You have to update the API version for all your Apex classes in order for them to work
in Lightning Experience.
B.Apex is not supported in the new Lightning Experience.
C.Your Apex code and queries continue to function as before.
D.All of the above
78. What should you look for when reviewing your installed packages before using them
with Lightning Experience?
A.A 'Lightning Ready' sash for the package on AppExchange.
B.An error message saying the package isn't 'Lightning Ready'.
C.A 'Lightning Ready' check mark on the Installed Packages page.
D.Errors in the JavaScript console when using the package.
79. Which of the following descriptions about the Lightning Component framework is
true?
A.It's a UI framework for developing web apps for mobile and desktop devices.
B.It uses JavaScript on the client side and Apex on the server side.
C.It's a modern framework for building single-page applications.
D.All of the above
80. What can you build with the Lightning Component framework?
A.Standalone app
B.Components to use inside Visualforce pages
C.Drag-and-drop components for Lightning App Builder
D.All of the above
81. How is the Lightning Component framework different from other web app
frameworks?
A.It is optimized for both mobile and desktop experiences and proves it with Salesforce1
and Lightning Experience.
B.It connects natively with services provided by the Salesforce platform.
C.It has specific opinions about how data access is performed and has specific security
requirements.
D.All of the above
Aura Attribute
Expressions
Instead of getting lost in words again, let’s dive right into making helloMessage work
as intended.
<aura:component>
<aura:attribute name="message" type="String"/>
<p>Hello! {!v.message}</p>
</aura:component>
Copy
We’re outputting the contents of message using the expression {!v.message} . That is,
this expression references the message attribute. The expression is evaluated, and
resolves to the text string that’s currently stored in message . And that’s what the
expression outputs into the body of the component.
{!<expression>}
The formal definition of an expression is a bit intimidating, but let’s look at and then
unpack it: An expression is any set of literal values, variables, sub-expressions, or
operators that can be resolved to a single value.
Let’s look at the helloMessageInteractive controller in more detail, and make that
explanation a bit more concrete.
({
})
The force:recordData tag also supports a set of target * attributes, which are
attributes that force:recordData populates itself. The target * attributes can be used to
allow access from the UI.
89. Which tool you will use to add a Lightning Component on a Record Page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
90. A developer andrew would like to execute or run jobs sequentially. Suggest
which would be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
91. Which class contains the RestRequest and RestResponse objects in RESTful
webservices?
a) Resthttp
b) RestContent
c) RestContext
d) RestContainer
92.Which access specifier you will use for a class and methods to publish them
as SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
93. To start the batch processing we have to use which of the following
method?
a) Database.StartBatch
b) Database.executeBatch
c) Database.processBatch
d) Database.runBatch
94. Select the appropriate options to fill in the blanks which should call the
client-side controller method by clicking on a button of a component
Greet.cmp
<div>
<lightning button label = “You look nice today”
Onclick=”--------------------------”
</div>
Greet.js
{
handleClick : function(cmp,event,helper)
{
alert(“Welcome”);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick }
Ex:-
<aura:component>
<aura:attribute name="text" type="String" default="Just a string. Waiting
for change."/>
<input type="button" value="Flawed HTML Button"
onclick="alert('this will not work')"/>
<br/>
<lightning:button label="Framework Button" onclick="{!c.handleClick}"/>
<br/>
{!v.text}
</aura:component>
95. Select the form-based component from the following which can be used to
display records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm
96. Below given is the controller code for a component. Identify what is missing in the
code.
public with sharing class ExpensesController {
public static List<Expense_c> getExpenses() {
return [SELECT Id, Name, Amount_c, Client_c, Date_c,
Reimbursed_c, CreatedDate
FROM Expense_c];
}
}
a. “@”AuraEnabled annotation for getExpense() ✓
b. “@”AllowAccess annotation for getExpense()
c. “@”isTest annotation for getExpense()
d. “@”Aura annotation for getExpense()
When using force:recordData , load the data once and pass it to child components as
attributes. This approach reduces the number of listeners and minimizes server calls,
which improves performance and ensures that your components show consistent
data.
Loading Records
The first thing you do to make a record available for your UI components is to load it.
Load the record by including force:recordData in your component while specifying
the recordId , mode , and layoutType or fields attributes. Valid values
for layoutType are FULL and COMPACT .
ldsDisplayRecord.cmp
<force:recordData aura:id="record"
fields="Name,BillingCity,BillingState"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields ="{!v.simpleRecord}"
mode="VIEW"/>
Salesforce provides two SOAP API WSDLs for two different use cases. The enterprise WSDL is
optimized for a single Salesforce org. It’s strongly typed, and it reflects your org’s specific
configuration, meaning that two enterprise WSDL files generated from two different orgs
contain different information.
The partner WSDL is optimized for use with many Salesforce orgs. It’s loosely typed,
and it doesn’t change based on an org’s specific configuration. Typically, if you’re
writing an integration for a single Salesforce org, use the enterprise WSDL. For
several orgs, use the partner WSDL.
For this unit, we’re using the enterprise WSDL to explore SOAP API. The first step is
to generate a WSDL file for your org. In your Trailhead Playground, from Setup, enter
API in the Quick Find box, then select API. On the API WSDL page, click Generate
Enterprise WSDL.
On the Generate Enterprise WSDL page, click Generate. When the WSDL is
generated, right-click on the page and save the WSDL file somewhere on your
computer. We’ll be using it shortly.
Here’s a tip for working with the enterprise WSDL. The enterprise WSDL reflects your
org’s specific configuration, so whenever you make a metadata change to your org,
regenerate the WSDL file. This way, the WSDL file doesn’t fall out of sync with your
org’s configuration.
ENDD---------------------------------------------------------------------------------------------------
1) True or false: OAuth 2.0 APIs enable a user to work in one app but see the data from
another.
a) True
b) False
2) You're creating a connected app that allows a Smart TV to display a customer's movie order history.
Which OAuth 2.0 flow would you use for the connected app?
4) Batch Apex is typically the best type of asynchronous processing when you want to:
a) Make a callout to a web service when a user updates a record
6) Which declarative tool would you use for the following use case? Guide customers
a) Flow Builder
b) Approvals
c) Apex
7) Which declarative tool would you use for the following use case? When an opportunity's discount is
higher than 40%, notify the CEO via email and request sign-off. Provide a way for the CEO to leave
comments.
a) Flow Builder
b) Approvals
c) Apex
8) Which declarative tool would you use for the following use case? When the Annual Revenue field
exceeds $500,000 on an account, automatically update the Customer
a) Flow Builder
b) Approvals
c) Apex
11) What is the name of the framework that includes Aura components?
a) Lightning Components
b) Angular
c) jQuery
d) WebObjects
b) VisualForce
c) JavaScript
d) Objective-C
13) Which of the following descriptions about the Lightning Component framework is true?
a) It's a UI framework for developing web apps for mobile and desktop devices.
14) What can you build with the Lightning Component framework?
a) Standalone app
b) Components to use inside Visualforce pages
15) How is the Lightning Component framework different from other web app frameworks?
a) It is optimized for both mobile and desktop experiences and proves it with
c) It has specific opinions about how data access is performed and has specific
security requirements
d) All of the above
a) Fewer XHRS
b) Shared record data across components
18) What attributes are required when using force record Data to load a record when the
component loads?
a) recordid, mode, layout Type, fields
19) Which of the following is NOT an advantage of data replication over data proxies?
a) A replicated data set offloads processing and requests from an origin data
server
b) A replicated data set is always and immediately in sync with the origin
data
c) A replicated data set reduces data access latency d) A replicated data set supports bidirectional
writes..
20) You can use Salesforce Connect to proxy which types of data sources:
a) Pre-shared keys
b) Basic usernames and passwords
c) OAuth
d) SAML
a) Web sockets
c) Message bus
d) Corba
24) REST API is best suited for which of these use cases?
a) Loading lots of data into your org for the first time
b) Writing a mobile or web app
25) SOAP API is best suited for which of these use cases?
26) Bulk API is best suited for which of these use cases?
27) Streaming API is best suited for which of these use cases?
a) Notifying users whenever a record is deleted
b) Creating hundreds of account records at once
c) Writing an app where the use of XML is required
d) Using a WSDL file to specify the operations allowed on standard and custom
objects
28) What are all the factors that contribute to the total API limit calculation?
a) Org edition and API usage over the previous month
b) OAuth provides Heroku Connect with API tokens after the user authorizes the
d) The end user of a Heroku app authorizes Heroku Connect via OAuth.
31) Heroku Connect data replication happens:
c) Near real time for writes to Salesforce, and on a 30-second polling window for
writes to Heroku Postgres
d) Near real time for writes to Salesforce, and either on a polling window or near
real time for writes to Heroku Postgres (depending on the user configuration)
a) Cross-object relationships
b) Data paging
c) Search
d) All of the above
34) Which of the following is NOT an advantage of Salesforce Connect over ETL?
b) If the origin is offline, the data is still available via Salesforce Connect
c) Standard protocols like OData can easily proxy external data into Salesforce.
35) True or false: You can integrate identity providers with Salesforce using connected apps.
a) True
b) False
36) How is OpenID Connect different from SAML a) You can't use Openld Connect to enable SSO
between two services
b) You can only use Openld Connect to enable SSO between two services.
c) Openld Connect is built for today's API economy because it adds an authentication layer on top of
OAuth 20
d) B and C
37) Which of the following scenarios describes how you can use a connected app?
a) Users can create their own connected apps to access their personal email
accounts.
b) Users can log in to an external application with their Salesforce or Experience
Cloud credentials
c) Users can authorize a mobile app to securely access defined Salesforce data on
their behalf.
d) B and C
38) What's the difference between a connected app developer and a connected app admin?
a) Only developers can set policies that explicitly define who can use connected
apps and where they can access the apps from...
b) Only admins can set policies that explicitly define who can use connected apps
and where they can access the apps from
c) There isn't a difference between developers and admins when it comes connected apps I
to
d) Only developers use connected apps. Admins have no role with connected apps
39) What type of jobs do not show up in the Apex Flex Queue.
41) True or false: Dynamic client registration enables resource servers to dynamically create
client apps as connected apps.
a) True
b) False
42) What role does your Salesforce org play in providing authorization for external API
gateways?
a) My Salesforce org requests the creation of client apps as connected apps from
43) Which of the following ISV features are available in Lightning Experience?
a) Trialforce
b) Usage Metrics Visualization app.
c) Package creation.
d) None of the above are available.
45) Which of the following is true of Apex in the new Lightning Experience:
a) You have to update the API version for all your Apex classes in order for them to
46) What should you look for when reviewing your installed packages before using them with
Lightning Experience?
47) The primary benefit of a workflow outbound message over an Apex trigger is:
a) Pre-shared keys I
b) Username and password credentials
c) OAuth flows using named credentials in the Remote Site settings
49) Heroku apps that handle callouts from Salesforce can be written in:
c) Python
d) PHP
b) OAuth
c) Signed request
d) Either OAuth or signed request
51) You can build Canvas apps and run them on Heroku with of the following languages:
a) Node.js / JavaScript
c) Python
đ) PHP
53) Which of the following statements about Lightning Components and Lightning
Experience is true?
a) Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
b) Lightning Experience is (mostly) built with Lightning Components.
c) Lightning Experience uses an app-centric development model using Lightning
Components.
a) Aura Components can only be used in the Lightning Experience and not the Salesforce mobile app
55) Applications on Heroku that use Salesforce REST APIs can use which authentication
mechanisms.
a) Anonymous access without credentials on trusted networks
b) Username and password with an OAuth connected app
c) OAuth web or user-agent flow in which the user authorizes a connected app
using browser redirects
d) B and C
e) A and C
a) Platform events
b) Generic streaming events
c) Change data capture events
d) The event bus
59) Which replay option specifies that the subscriber receives event notifications with replay IDs 6, 7, 8,
and 9?
a) 6
b) 5
c) -2
d) -1
60) Which of the following SOQL query a valid pushtopic query? SELECT Name, Phone
61) What channel name corresponds to a platform event that you defined with the label of
a) /event/Solar_panel_Event
b) /topic/Solar_panel_Event
c) /event/Solar_panel_Event C
e) /event/Solar_ panel_Event_e
b) Create a Push Topic, and then POST a request to /Push Topic/<PushTopic/d>push c) POST a request to
/PushTopic/Push
63) Which of the following features of Visualforce do NOT work in Lightning Experience?
64) Which of the following is NOT true about the user interface and visual design in
Lightning Experience:
Which of the following statements is true about creating apps with visualforce:
a) Visualforce is designed primarily for page-centric web apps.
b) Visualforce renders the page on the server.
66) Which of the following statements is NOT true about creating apps with Lightning
components:
68) Which attribute of force:recordData is set to a localized error message if an error occurs
on loading a component?
a) targetFields
b) targetError
c) Error
d) fieldsError
69) My Domain is NOT required at the very beginning to develop with Lightning Components?
a) True
b) False
70) Which tool you will use to add a lightning component on a record page?
c) Form Builder
d) App Builder
71) Select the inappropriate reason from the following to integrate apps on Heroku with salesforce:
a) Data replication
b) Data proxies
c) Data Security
d) Custom user interfaces
72) Which are two types of SOAP API WSDLS provided by Salesforce? (Select 2)
a) Company WSDL
b) Enterprise WSDL
c) Partner WSDL
d) Person WSDL
74) Which type of app enables an external application to integrate with Salesforce using API
b) Service app
c) Connected app
d) External app
75) Which of the following statements is true about external gellouts: a) SOAP callouts use xml and may
use a wsdl for code generation.
b) HTTP callouts typically use JSON but can use XML as well.
c) HTTP callouts are generally easier to work with than SOAP callouts,
76) A developer, Andrew would like to execute or run jobs sequentially. Suggest which would
a) Queueable
b) Database Batchable
77) A developer would like to bypass the total number of records retrieved by SOQL queries in the start
method. Which class object you would suggest to use?
a) Database.QueryLocator
b) Iterable
c) Database QueryRecords
d) Database.Iterable
78) A developer want to send JSON data through a POST request in the web service. Which
a) Data-Type
b) Endpoint
c) Content-Type
d) body
a) Before undelete
b) After insert
c) Before update
d) After delete
80) Which annotation you will use to declare a method as test method?
a) "@isTest”
b) "@future
c) "@Rest
d) "@TestMethod"
81) Which class contains the RestRequest and RestResponse objects in RESTful
webservice?
a) RestHttp
b) RestContent
c) RestContext
d) RestContainer
82) Which of the following attribute is used to map the URL pattern to RestResource annotation?
a) urlPattern
b) urlText
c) uriMap
d) urlMapping
83) How many maximum number of Apex jobs we could schedule at one time?
a) 50
b) 100
c) 150
d) 200
84) Identify the correct apex class which allows to submit jobs for asynchronous processing
a) AsyncApex
b) Stateful
c) Batchable
d) Queueable
85) Select the second generation of event products related to streaming API. (Select 2)
d) Platform Events
86) A Developer, Brian, would like to create an optimized WSLD for use with many salesforce org. Which
type of WSDL should he create?
a) Company WSDL
b) Person WSDL
c) Enterprise WSDL
d) Partner WSDL
87) Identify the correct the attribute of force:recordData component which determines what operations
are available to perform with the record
a) Mode
b) recordID
c) Fields
d) LayoutType
a) UNDELETE
b) GET
c) POST
d) DELETE
e) PUT
89) A developer called a web service from an apex code. Which response status code she should check
to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
90) A developer is loading a record from the database using force recordData component. Which
attribute is populated with the loaded record?
a) tagetFields
b) targetRecord
c) targetError
d) targetRow
91) What should be the minimum code coverage % before deploying an apex code?
a) 71
b) 73
c) 75
d) 72
92) Select the inappropriate method from the following which informs the runtime that mock
b) Test setMock
c) Test Mock
d) Test startTest
93) To make a Lightning component available for any type of page, it must implement which interface?
a) flexipage:availableForAllPageTypes
b) flexipage availableForPageTypes
c) flexipage:availableForAllTypes
d) flexipage:ForAllPageTypes
94) Which annotation will be used to expose an apex class as REST resource?
a) “@”RestResource
b) "@"ResourceRest
c) "@HttpResource
d) "@"RestHttp
95) Which method causes the entire set of operations to be rolled back?
a) error()
b) showError()
c) isError()
d) addError()
96) To get a fresh set of governor limits in an apex test class, which method shall be used?
a) Test.runAs
b) Test.setMock
c) Test.startTest and Test stop Test
d) Test.assert
97) A developer like to monitor the progress of future jobs. Suggest the correct way.
a) From setup, select Apex Jobs
98) Below given is the controller code for a component. Identify what is missing in the code. Public with
sharing class ExpensesController( Public static List<Expense c> getExpenses(){
Return (SELECT Id, Name, Amount c, Client c, Date _c, Reimbursed c, CreatedDate
99) A component has an attribute message. Select the appropriate statement to set the value of
message from client-controller method with newMessage. handleClick2
function(component,event,helper){
a) component set("message",newMessage);
b) component.set("(!v.message)" newMessage);
c) component.set("v.message" newMessage);
d) component.get("v.message",newMessage);
100) A Developer, Amy, would like to create an optimized WSLD for a single salesforce
e) Company WSDL
1) Person WSDL
g) Enterprise WSDL
h) Partner WSDL
101) A Lightning component developer want to fetch data of a custom object Review_c from database
and want to display on a component. What type of controller should be used?
b) Extension Controller
c) Client-side Controller with Server-side Controller
d) Standard Controller
102) Identify the correct trigger variable which shows the currently executing code
in apex trigger.
a) isinsert
b) isExecuting
c) isAfter
d) isDelete
104) Which of following API is based on REST principles and is optimized for working with
a) Bulk Api
b) SOAP Api
c) Streaming Api
105) To start the batch processing, we have to use which of the following method?
a) Database
b) Database.executeBatch
c) Database
d) Database
106) Which of the following annotation you will add to your method to expose it as a REST Resource
that can be called by an HTTP GET request? I
a) "@HttpPost
b)”@” HttpGet
c) "@HttpPut
d) "@HttpDelete
107) Which of the following is NOT the use of future methods?
a) Callout to external Web Services
b) Isolating DML operations on different sObject types prevent mixed DML error
c) Override organization-wide sharing defaults
108) Which are three methods of Heroku and Salesforce Integration? (Select
a) Heroku Connect
b) Salesforce SOAP APIs.
c) Salesforce REST APIs
d) Callouts.
E)Canvas
109) Suggest an attribute to a developer to declare that the component handles the event
b) recordData
c) recordUpdated
d) recordChanges
110) Below given is the controller code for a component. How would a component use this controller?
Select the appropriate option. Public with sharing class ExpenseController{
b) <aura.component controller="ExpenseController'>
c) <aura:component implements=’ ExpenseController'>
d) <aura:component class='ExpenseController>
@future(callout=true)
b) Place the callout method in an asynchronous method that is annotated with
@future
c) Place the callout method in an asynchronous method that is annotated with @HttpGet(callout=true)
d) Place the callout method in an asynchronous method that is annotated with @HttpPost(callout=true)
1) True or false: OAuth 2.0 APIs enable a user to work in one app but see the data from
another.
a) True
b) False
2) You're creating a connected app that allows a Smart TV to display a customer's movie
order history. Which OAuth 2.0 flow would you use for the connected app?
a) OAuth 2.0 web server flow
b) OAuth 2.0 device flow
c) OAuth 2.0 JSON Web Token Exchange (JWT) bearer flow
d) OAuth 2.0 user agent flow
4) Batch Apex is typically the best type of asynchronous processing when you want to:
a) Make a callout to a web service when a user updates a record.
b) Schedule a task to run on a weekly basis.
c) Update all records in your org.
d) Send a rickroll email to a contact
6) Which declarative tool would you use for the following use case? Guide customers
through the process of troubleshooting issues with your product.
a) Flow Builder
b) Approvals
c) Apex
7) Which declarative tool would you use for the following use case? When an opportunity's
discount is higher than 40%, notify the CEO via email and request sign-off. Provide a
way for the CEO to leave comments.
a) Flow Builder
b) Approvals
c) Apex
8) Which declarative tool would you use for the following use case? When the Annual
Revenue field exceeds $500,000 on an account, automatically update the Customer
Priority field to High.
a) Flow Builder
b) Approvals
c) Apex
11) What is the name of the framework that includes Aura components?
a) Lightning Components
b) Angular
c) jQuery
d) WebObjects
13) Which of the following descriptions about the Lightning Component framework is true?
a) It’s a UI framework for developing web apps for mobile and desktop devices.
b) It uses JavaScript on the client-side and Apex on the server-side.
c) It’s a modern framework for building single-page applications.
d) All of the above
14) What can you build with the Lightning Component framework?
a) Standalone app
b) Components to use inside Visualforce pages
c) Drag-and-drop components for Lightning App Builder
d) All of the above
15) How is the Lightning Component framework different from other web app frameworks?
a) It is optimized for both mobile and desktop experiences and proves it with
Salesforce1 and Lightning Experience.
b) It connects natively with services provided by the Salesforce platform.
c) It has specific opinions about how data access is performed and has specific
security requirements.
d) All of the above
18) What attributes are required when using force:recordData to load a record when the
component loads?
a) recordId, mode, layoutType, fields
b) recordId, mode, and layoutType or fields
c) recordId, mode, targetRecord
d) recordId, mode, fields, targetRecord, targetError
19) Which of the following is NOT an advantage of data replication over data proxies?
a) A replicated data set offloads processing and requests from an origin data
server.
b) A replicated data set is always and immediately in sync with the origin
data.
c) A replicated data set reduces data access latency.
d) A replicated data set supports bidirectional writes.
20) You can use Salesforce Connect to proxy which types of data sources:
a) OData 2.0 and 4.0
b) REST with JSON payloads
c) REST with XML payloads
d) SOAP
e) All of the above
21) Which technology do Salesforce REST APIs use for authentication?
a) Pre-shared keys
b) Basic usernames and passwords
c) OAuth
d) SAML
24) REST API is best suited for which of these use cases?
a) Loading lots of data into your org for the first time
b) Writing a mobile or web app
c) Deleting 100,000 records at once
d) Pushing notifications whenever data is changed
25) SOAP API is best suited for which of these use cases?
a) Building a server-to-server integration
b) Writing an app that requires using JSON
c) Updating thousands of records at once
d) Building a slick UI for a mobile app
26) Bulk API is best suited for which of these use cases?
a) Deleting several records, one record at a time
b) Writing a mobile chat app
c) Building a new Salesforce UI
d) Deleting 100,000 records at once
27) Streaming API is best suited for which of these use cases?
a) Notifying users whenever a record is deleted
b) Creating hundreds of account records at once
c) Writing an app where the use of XML is required
d) Using a WSDL file to specify the operations allowed on standard and custom
objects
28) What are all the factors that contribute to the total API limit calculation?
a) Org edition and API usage over the previous month
b) Org edition, license type, and expansion packs
c) License type and expansion packs
d) Number of Salesforce employees swabbing the deck
34) Which of the following is NOT an advantage of Salesforce Connect over ETL?
a) The data is always fetched on demand.
b) If the origin is offline, the data is still available via Salesforce Connect.
c) Standard protocols like OData can easily proxy external data into Salesforce.
d) Data security can be enforced using per-user or per-application authentication.
35) True or false: You can integrate identity providers with Salesforce using connected apps.
a) True
b) False
37) Which of the following scenarios describes how you can use a connected app?
a) Users can create their own connected apps to access their personal email
accounts.
b) Users can log in to an external application with their Salesforce or Experience
Cloud credentials
c) Users can authorize a mobile app to securely access defined Salesforce data on
their behalf.
d) B and C
38) What’s the difference between a connected app developer and a connected app admin?
a) Only developers can set policies that explicitly define who can use connected
apps and where they can access the apps from.
b) Only admins can set policies that explicitly define who can use connected apps
and where they can access the apps from.
c) There isn’t a difference between developers and admins when it comes to
connected apps
d) Only developers use connected apps. Admins have no role with connected apps
39) What type of jobs do not show up in the Apex Flex Queue.
a) Future Method Jobs
b) Batch Apex Jobs
c) Queueable Apex Jobs
d) Scheduled Apex Jobs
42) What role does your Salesforce org play in providing authorization for external API
gateways?
a) My Salesforce org requests the creation of client apps as connected apps from
the external API gateway.
b) My Salesforce org hosts the protected data
c) My Salesforce org is the OAuth authorization server that protects resources
hosted on an external API.
d) My Salesforce org asks the external API gateway to authenticate a client app.
43) Which of the following ISV features are available in Lightning Experience?
a) Trialforce
b) Usage Metrics Visualization app.
c) Package creation.
d) None of the above are available.
45) Which of the following is true of Apex in the new Lightning Experience:
a) You have to update the API version for all your Apex classes in order for them to
work in Lightning Experience.
b) Apex is not supported in the new Lightning Experience.
c) Your Apex code and queries continue to function as before.
d) All of the above
46) What should you look for when reviewing your installed packages before using them with
Lightning Experience?
a) A 'Lightning Ready' sash for the package on AppExchange.
b) An error message saying the package isn't 'Lightning Ready'.
c) A 'Lightning Ready' check mark on the Installed Packages page.
d) Errors in the JavaScript console when using the package.
47) The primary benefit of a workflow outbound message over an Apex trigger is:
a) The message can deliver the payload only as SOAP.
b) The message supports different authentication mechanisms.
c) Messages are completely declarative.
d) The message can handle every database event.
49) Heroku apps that handle callouts from Salesforce can be written in:
a) Node.js / JavaScript
b) Java, Scala, Clojure
c) Python
d) PHP
e) All of the above
51) You can build Canvas apps and run them on Heroku with of the following languages:
a) Node.js / JavaScript
b) Java, Scala, Clojure
c) Python
d) PHP
e) All of the above
53) Which of the following statements about Lightning Components and Lightning
Experience is true?
a) Lightning Experience is something you use directly, Lightning Components are
something you build apps with.
b) Lightning Experience is (mostly) built with Lightning Components.
c) Lightning Experience uses an app-centric development model using Lightning
Components.
d) All of the above
55) Applications on Heroku that use Salesforce REST APIs can use which authentication
mechanisms:
a) Anonymous access without credentials on trusted networks
b) Username and password with an OAuth connected app
c) OAuth web or user-agent flow in which the user authorizes a connected app
using browser redirects
d) B and C
e) A and C
59) Which replay option specifies that the subscriber receives event notifications with replay
IDs 6, 7, 8, and 9?
a) 6
b) 5
c) -2
d) -1
60) Which of the following SOQL query a valid pushtopic query? SELECT Name, Phone
FROM Contact WHERE MailingCity=’Indianapolis’
a) WHERE clauses aren’t supported for PushTopics
b) The SELECT statement doesn’t include an ID
c) Contact isn’t a supported object for pushTopic queries
d) The query is valid
61) What channel name corresponds to a platform event that you defined with the label of
solar panel event?
a) /event/Solar_panel_Event
b) /topic/Solar_panel_Event
c) /event/Solar_panel_Event__c
d) /event/Solar panel Event
e) /event/Solar_panel_Event__e
63) Which of the following features of Visualforce do NOT work in Lightning Experience?
a) Creating custom apps and tabs
b) Overriding standard actions with Visualforce pages
c) Using window location in JavaScript code
d) Remote Objects
64) Which of the following is NOT true about the user interface and visual design in Lightning
Experience:
a) PDFs render with the Lightning Experience visual design
b) You can’t hide the Lightning Experience main navigation header or sidebar
c) The <apex:inputField> tag renders with the Salesforce Classic appearance
d) The Standard Visualforce header and sidebar are hidden
65) Which of the following statements is true about creating apps with visualforce:
a) Visualforce is designed primarily for page-centric web apps.
b) Visualforce renders the page on the server.
c) Visualforce will be fully supported by Salesforce for years to come.
d) All of the above
66) Which of the following statements is NOT true about creating apps with Lightning
components:
a) Lightning components are designed primarily for app-centric web apps.
b) Lightning components can be used everywhere Visualforce can be used.
c) Lightning components render the page on the client.
d) All of the above
68) Which attribute of force:recordData is set to a localized error message if an error occurs
on loading a component?
a) targetFields
b) targetError
c) Error
d) fieldsError
69) My Domain is NOT required at the very beginning to develop with Lightning
Components?
a) True
b) False
70) Which tool you will use to add a lightning component on a record page?
a) Flow Builder
b) Report Builder
c) Form Builder
d) App Builder
71) Select the inappropriate reason from the following to integrate apps on Heroku with
salesforce:
a) Data replication
b) Data proxies
c) Data Security
d) Custom user interfaces
72) Which are two types of SOAP API WSDLs provided by Salesforce? (Select 2)
a) Company WSDL
b) Enterprise WSDL
c) Partner WSDL
d) Person WSDL
73) SOAP web services are commonly used for:
a) Simple, light weight services that are typically stateless.
b) Public APIs that use HTTP and JSON.
c) Enterprise apps that require a formal exchange format or stateful operations.
d) No one uses SOAP any longer
74) Which type of app enables an external application to integrate with Salesforce using API
and standard protocols?
a) Salesforce app
b) Service app
c) Connected app
d) External app
76) A developer, Andrew would like to execute or run jobs sequentially. Suggest which would
be the appropriate class?
a) Queueable
b) Database.Batchable
c) Database.Stateful
d) Database.Iterable
77) A developer would like to bypass the total number of records retrieved by SOQL queries
in the start method. Which class object you would suggest to use?
a) Database.QueryLocator
b) Iterable
c) Database.QueryRecords
d) Database.Iterable
78) A developer want to send JSON data through a POST request in the web service. Which
request header should be set to JSON?
a) Data-Type
b) Endpoint
c) Content-Type
d) body
80) Which annotation you will use to declare a method as test method?
a) “@isTest”
b) “@future”
c) “@Rest”
d) “@TestMethod”
81) Which class contains the RestRequest and RestResponse objects in RESTful
webservice?
a) RestHttp
b) RestContent
c) RestContext
d) RestContainer
82) Which of the following attribute is used to map the URL pattern to RestResource
annotation?
a) urlPattern
b) urlText
c) urlMap
d) urlMapping
83) How many maximum number of Apex jobs we could schedule at one time?
a) 50
b) 100
c) 150
d) 200
84) Identify the correct apex class which allows to submit jobs for asynchronous processing
with member variables of Non-primitive types?
a) AsyncApex
b) Stateful
c) Batchable
d) Queueable
85) Select the second generation of event products related to streaming API. (Select 2)
a) Change Data Capture
b) PushTopic Events
c) Generic Streaming Events
d) Platform Events
86) A Developer, Brian, would like to create an optimized WSLD for use with many
salesforce org. Which type of WSDL should he create?
a) Company WSDL
b) Person WSDL
c) Enterprise WSDL
d) Partner WSDL
87) Identify the correct the attribute of force:recordData component which determines what
operations are available to perform with the record
a) Mode
b) recordID
c) Fields
d) LayoutType
89) A developer called a web service from an apex code. Which response status code she
should check to ensure that the request is successful?
a) 500
b) 404
c) 201
d) 200
90) A developer is loading a record from the database using force:recordData component.
Which attribute is populated with the loaded record?
a) tagetFields
b) targetRecord
c) targetError
d) targetRow
91) What should be the minimum code coverage % before deploying an apex code?
a) 71
b) 73
c) 75
d) 72
92) Select the inappropriate method from the following which informs the runtime that mock
callouts are used in the test method
a) Test.runAs
b) Test.setMock
c) Test.Mock
d) Test.startTest
93) To make a Lightning component available for any type of page, it must implement which
interface?
a) flexipage:availableForAllPageTypes
b) flexipage:availableForPageTypes
c) flexipage:availableForAllTypes
d) flexipage:ForAllPageTypes
94) Which annotation will be used to expose an apex class as REST resource?
a) “@”RestResource
b) “@”ResourceRest
c) “@”HttpResource
d) “@”RestHttp
95) Which method causes the entire set of operations to be rolled back?
a) error()
b) showError()
c) isError()
d) addError()
96) To get a fresh set of governor limits in an apex test class, which method shall be used?
a) Test.runAs
b) Test.setMock
c) Test.startTest and Test.stopTest
d) Test.assert
97) A developer like to monitor the progress of future jobs. Suggest the correct way.
a) From setup, select Apex Jobs
b) Query CronTrigger to find future job
c) Query AsyncApexJob to find future job
d) Query CronJobDetail to find future job
98) Below given is the controller code for a component. Identify what is missing in the code.
Public with sharing class ExpensesController{
Public static List<Expense__c> getExpenses(){
Return [SELECT Id, Name, Amount__c, Client__c, Date__c,
Reimbursed__c, CreatedDate
FROM Expenses__c];
}
}
a) ‘@’AuraEnabled annotation for getExpense()
b) ‘@’AllowAccess annotation for getExpense()
c) ‘@’isTest annotation for getExpense()
d) ‘@’Aura annotation for getExpense()
99) A component has an attribute message. Select the appropriate statement to set the
value of message from client-controller method with newMessage.
handleCLick2:function(component,event,helper){
var newMessage = event.getSource().get(“v.label”);
console.log(“handleClick2:Message:”+newMessage);
//Add correct statement below
—--------------------------------
}
a) component.set(“message”,newMessage);
b) component.set(“{!v.message}”,newMessage);
c) component.set(“v.message”,newMessage);
d) component.get(“v.message”,newMessage);
100) A Developer, Amy, would like to create an optimized WSLD for a single salesforce
org. Which type of WSDL should she create?
e) Company WSDL
f) Person WSDL
g) Enterprise WSDL
h) Partner WSDL
101) A Lightning component developer want to fetch data of a custom object Review__c
from database and want to display on a component. What type of controller should be
used?
a) Standard List Controller
b) Extension Controller
c) Client-side Controller with Server-side Controller
d) Standard Controller
102) Identify the correct trigger variable which shows the currently executing code in apex
trigger.
a) isInsert
b) isExecuting
c) isAfter
d) isDelete
103) Select the appropriate option to fill in the blanks which should call the client-side
controller method by clicking on a button of a component
greet.cmp
<div>
<lightning:button labels=”You look nice today”
onClick =”-----------”/>
</div>
greet.js
{
handleClick : function(comp,event,helper){
alert(‘Welcome’);
}
}
a) {!handleClick}
b) {!c.handleClick}
c) {c.handleClick}
d) {!chandleClick}
104) Which of following API is based on REST principles and is optimized for working with
larger sets of data?
a) Bulk Api
b) SOAP Api
c) Streaming Api
d) None of the above
105) To start the batch processing, we have to use which of the following method?
a) Database
b) Database.executeBatch
c) Database
d) Database
106) Which of the following annotation you will add to your method to expose it as a REST
Resource that can be called by an HTTP GET request?
a) “@”HttpPost
b) “@”HttpGet
c) “@”HttpPut
d) “@”HttpDelete
108) Which are three methods of Heroku and Salesforce Integration? (Select 3)
a) Heroku Connect.
b) Salesforce SOAP APIs.
c) Salesforce REST APIs
d) Callouts.
e) Canvas.
109) Suggest an attribute to a developer to declare that the component handles the event
after changes in the record (NOT SURE first marked c)
a) recordEdited
b) recordData
c) recordUpdated
d) recordChanges
110) Below given is the controller code for a component. How would a component use this
controller? Select the appropriate option.
Public with sharing class ExpenseController{
//Some code here…
}
a) <aura:component standardController=’ExpenseController’>
b) <aura:component controller=’ExpenseController’>
c) <aura:component implements=’ExpenseController’>
d) <aura:component class=’ExpenseController’>
113) When making a callout from a method, the method waits for external service to send
back the callout response. A developer does not want this behaviour. Suggest the
appropriate solution.
a) Place the callout method in an asynchronous method that is annotated with
@future(callout=true) or use Queueable Apex
b) Place the callout method in an asynchronous method that is annotated with
@future
c) Place the callout method in an asynchronous method that is annotated with
@HttpGet(callout=true)
d) Place the callout method in an asynchronous method that is annotated with
@HttpPost(callout=true)
117) Consider the following code. Select appropriate statement to print the value of
message attribute.
<aura:component>
<aura:attribute name=”message” type=”String”/>
<p>Hello! --------------------</p>
</aura:component>
a) {v.message}
b) {! message}
c) {message}
d) {!v.message}
118) Which Context variable provides a list of sObjects which we can use only in insert
,update and delete trigger?
a) old
b) oldMap
c) new
d) newMap
119) Which access specifier you will use for a class and methods to publish them as
SOAP web-service?
a) Public, webservice
b) Public, webmethod
c) Global, webmethod
d) Global , webservices
120) Select the form-based component from the following which can be used to display
records only.
a) lightning:recordDisplayForm
b) lightning:recordForm
c) lightning:recordEditForm
d) lightning:recordViewForm