Font size
S
M
L
XL
WorksheetsSalesforce Quiz (LNCT Group of Colleges ,Bhopal) - 17-Mar'25
Total questions: 60
Worksheet time: 2hrs 0mins
Name
Class
Date
1.
1. What governor limit applies to SOQL queries in a synchronous transaction?
a)
A) 50
b)
B) 100
c)
C) 300
d)
D) 200
2.
2.Which statement is true about a custom controller?
a)
A) A custom controller uses only declarative logic
b)
B) A custom controller must extend a standard controller
c)
C) A custom controller is written in Apex and does not use the standard controller
d)
D) A custom controller cannot access Visualforce pages
3.
3.What is the purpose of @future annotation in Apex?
a)
A) Run methods synchronously
b)
B) Run methods asynchronously
c)
C) Run batch jobs
d)
D) Allow recursion
4.
4.Which object supports both standard and custom fields in Salesforce?
a)
A) Account
b)
B) Workflow
c)
C) Validation Rule
d)
D) Apex Class
5.
5.How can you avoid exceeding governor limits in Apex?
a)
A) Using nested loops
b)
B) Using static variables
c)
C) Bulkifying the code
d)
D) Using DML inside a loop
6.
6.What are the valid Apex trigger events?
a)
A) Before Insert, After Insert
b)
B) Before Update, After Update
c)
C) Before Delete, After Delete
d)
D) All of the above
7.
7.How many records can be retrieved in a single SOQL query?
a)
A) 5,000
b)
B) 25,000
c)
C) 50,000
d)
D) 1,00,000
8.
8.What is the maximum number of DML statements allowed in a single Apex transaction?
a)
A) 150
b)
B) 200
c)
C) 250
d)
D) 500
9.
9.What is the main difference between REST and SOAP API?
a)
A) SOAP API is faster than REST API
b)
B) REST API uses JSON while SOAP API uses XML
c)
C) REST API requires WSDL
d)
D) SOAP API cannot be used in Salesforce
10.
10.Which annotation is required to expose an Apex method for use in Lightning Web Components?
a)
A) @RemoteAction
b)
B) @future
c)
C) @AuraEnabled
d)
D) @HttpGet
11.
11.What is the difference between a Role and a Profile in Salesforce?
a)
A) Profiles control record visibility, roles control permissions
b)
B) Profiles define object permissions, roles define data access hierarchy
c)
C) Profiles are optional, roles are required
d)
D) Roles control object-level security
12.
12. What is the purpose of System.debug() in Apex?
a)
A) To log debug messages in the Developer Console
b)
B) To commit transactions
c)
C) To create records
d)
D) To execute SOQL queries
13.
13.Which statement is true about the following Apex method?
@AuraEnabled
public static String myMethod() {
return 'Hello';
}
a)
A) The method cannot be called from Lightning
b)
B) The method can be used in Lightning Web Components
c)
C) The method must be an instance method
d)
D) The method requires @RemoteAction
14.
14.Identify the error in the following trigger:
trigger AccountTrigger on Account (before insert) {
for (Account acc : Trigger.new) {
acc.Name = 'New Account';
insert acc;
}
}
a)
A) SOQL inside a loop
b)
B) Trigger.new cannot be modified
c)
C) DML statement inside a loop
d)
D) No error
15.
15.How do you correctly write a SOQL query in Apex?
a)
A) List accs = [SELECT Id, Name FROM Account];
b)
B) SELECT * FROM Account;
c)
C) Account acc = new Account().findAll();
d)
D) List accs = new SOQL(Account);
16.
16.Which method is used to execute batch Apex?
a)
A) executeBatch()
b)
B) Database.executeBatch()
c)
C) startBatch()
d)
D) runBatch()
17.
17.What will be the output of this SOQL query?
List accs = [SELECT Id FROM Account LIMIT 10];
System.debug(accs.size());
a)
A) Up to 10 records
b)
B) Exactly 10 records
c)
C) Compilation Error
d)
D) 0
18.
18.What is a Junction Object in Salesforce?
a)
A) An object used to create many-to-many relationships
b)
B) A standard object
c)
C) A UI component
d)
D) A field type
19.
19.What is the purpose of a Connected App in Salesforce?
a)
A) To integrate Salesforce with external applications
b)
B) To create custom objects
c)
C) To manage roles
d)
D) To modify metadata
20.
20.What is the purpose of the Transient keyword in Apex?
a)
A) To make variables public
b)
B) To prevent variables from being stored in the View State
c)
C) To define a new class
d)
D) To perform DML operations
21.
21. How do you declare a public property in a Lightning Web Component?
a)
A) @public
b)
B) @api
c)
C) @api propertyName;
d)
D) public propertyName;
22.
22.What is the correct way to call an Apex method from LWC?
a)
A) import { methodName } from 'ApexClassName';
b)
B) @wire(ApexMethod)
c)
C) @wire(ApexMethod) variableName;
d)
D) fetch(ApexMethod);
23.
23. Which HTTP method is used to retrieve data from a REST API?
a)
A) GET
b)
B) POST
c)
C) PUT
d)
D) DELETE
24.
24. What will be the response of this Apex REST method?
@RestResource(urlMapping='/myservice/*')
global with sharing class MyService {
@HttpGet
global static String getMethod() {
return 'Hello, world!';
}
}
a)
A) JSON output
b)
B) Plain text: "Hello, world!"
c)
C) XML response
d)
D) HTTP error
25.
25.What does a Connected App do in Salesforce?
a)
A) Integrates Salesforce with external applications
b)
B) Runs batch jobs
c)
C) Creates custom objects
d)
D) Automates workflows
26.
26.What is the purpose of the Continuation class in Apex?
a)
A) Handles long-running callouts asynchronously
b)
B) Runs batch Apex
c)
C) Schedules jobs
d)
D) Encrypts data
27.
27.What annotation marks a class as a test class?
a)
A) @isTest
b)
B) @Test
c)
C) @ApexTest
d)
D) @TestMethod
28.
28. What is the purpose of Test.startTest() and Test.stopTest()?
a)
A) To execute a test case
b)
B) To commit transactions
c)
C) To reset governor limits during testing
d)
D) To start asynchronous execution
29.
29.Which method in Batch Apex is responsible for processing records?
a)
A) execute()
b)
B) public void execute(Database.BatchableContext bc, List scope)
c)
C) start()
d)
D) finish()
30.
30.What does 'without sharing' in Apex do?
a)
A) Executes the class without enforcing sharing rules
b)
B) Increases security
c)
C) Prevents SOQL injection
d)
D) Runs triggers automatically
31.
31.Which of the following is NOT a data type in Apex?
a)
a) Integer
b)
b) String
c)
c) Blob
d)
d) MapList
32.
32.What is the purpose of the Database.insert method with the allOrNone parameter set to false?
a)
a) It rolls back the entire transaction if any record fails to insert
b)
b) It allows partial success and returns errors for failed records
c)
c) It prevents any records from being inserted
d)
d) It executes asynchronously
33.
33.Which of the following is NOT a trigger context variable?
a)
a) Trigger.new
b)
b) Trigger.old
c)
c) Trigger.isExecuting
d)
d) Trigger.isFuture
34.
34.Which of the following is NOT a valid Apex collection?
a)
a) List
b)
b) Set
c)
c) Map
d)
d) Array
35.
35.What is the purpose of the Schema class in Apex?
a)
a) To describe metadata about Salesforce objects and fields
b)
b) To execute SOQL queries
c)
c) To create new records
d)
d) To define triggers
36.
36.Which of the following is NOT a valid SOQL clause?
a)
a) SELECT
b)
b) FROM
c)
c) WHERE
d)
d) JOIN
37.
37.What is the purpose of the Developer Console in Salesforce?
a)
a) To write and debug Apex code
b)
b) To create custom objects
c)
c) To manage user permissions
d)
d) To execute SOQL queries
38.
38.What is the output of the following Apex code?
Integer x = 10;
Integer y = x++;
System.debug(y);
a)
a) 10
b)
b) 11
c)
c) 12
d)
d) Error
39.
39.What is the purpose of the wire decorator in LWC?
a)
a) To call Apex methods imperatively
b)
b) To call Apex methods reactively
c)
c) To define CSS styles
d)
d) To create a custom event
40.
40.Which method is used to dispatch a custom event in LWC?
a)
a) this.dispatchEvent()
b)
b) this.fireEvent()
c)
c) this.triggerEvent()
d)
d) this.createEvent()
41.
41.Which method is used to send an HTTP request in Apex?
a)
a) Http.send()
b)
b) HttpRequest.send()
c)
c) Http.sendRequest()
d)
d) Http.sendHttpRequest()
42.
42.What is the purpose of the System.runAs() method in test classes?
a)
a) To execute code as a specific user
b)
b) To execute asynchronous code
c)
c) To define a test class
d)
d) To reset governor limits
43.
43.What is the maximum number of batch jobs that can be queued or active at once?
a)
a) 5
b)
b) 10
c)
c) 25
d)
d) 100
44.
44.Which method is used to define the start of a batch job?
a)
a) start()
b)
b) execute()
c)
c) finish()
d)
d) begin()
45.
45.What is the purpose of the finish() method in Batch Apex?
a)
a) To execute the main logic of the batch job
b)
b) To define the start of the batch job
c)
c) To perform post-processing tasks
d)
d) To define test data
46.
46.What is the output of the following SOQL query?
SELECT Id, Name FROM Account WHERE Name LIKE '%Test%' LIMIT 1
a)
a) Returns the first account with "Test" in its name
b)
b) Returns all accounts with "Test" in their name
c)
c) Throws an error
d)
d) Returns no records
47.
47.Which of the following is true about SOSL?
a)
a) It can search across multiple objects
b)
b) It is used to create custom objects
c)
c) It is used to define triggers
d)
d) It cannot return more than 200 records
48.
48.Apex trigger that prevents deletion of an Account if it has related Opportunities.
trigger PreventAccountDeletion on Account (before delete) {
for (Account acc : Trigger.old) {
if ([SELECT COUNT() FROM Opportunity WHERE AccountId = :acc.Id] > 0) {
acc.addError('Cannot delete Account with related Opportunities.');
}
}
}
Find Error in the code
a)
No Error
b)
Error in Context Variable
c)
Trigger Event is wrong
d)
SOQL Error
49.
49.Write a SOQL query to retrieve all Contacts associated with Accounts that have a Type of 'Customer'.
a)
[SELECT Id, Name FROM Contact WHERE Account.Type = 'Customer'];
b)
SELECT Id, Name FROM Contact WHERE Account.Type = 'Customer'
c)
[ Id, Name FROM Contact WHERE Account.Type = 'Customer'];
d)
Id, Name FROM Contact WHERE Account.Type = 'Customer'
50.
50.An LWC JavaScript method to call an Apex method imperatively.
import { LightningElement } from 'lwc';
import getAccountList from '@salesforce/apex/AccountController.getAccountList';
export default class AccountList extends LightningElement {
accounts;
error;
handleLoad() {
getAccountList()
.then(result => {
this.accounts = result;
})
.catch(error => {
this.error = error;
});
}
}
Find the error
a)
No Error
b)
Syntax Error
c)
Import method is wrong
d)
console.log missing
51.
51. Which layout is selected by default when creating a flow in the Flow Builder?
a)
a. Free Form
b)
b. Auto-Layout
c)
c. Dependent Layout
d)
d. Free Layout
52.
52. A developer has enabled the Einstein search feature for advanced search. However, the users cannot view some required fields in search results. What should be configured to fix this issue?
a)
a. Search Layout
b)
b. Page Layout
c)
c. Lightning Pages
d)
d. Einstein Search Settings
53.
53.How do you use the Lightning Data Service to read and write data to Salesforce?
a)
a. By using the @lwc/wire adapter in a Lightning Web Component.
b)
b. By invoking SOQL queries directly from the component.
c)
c. By directly editing Salesforce records from the Lightning component.
d)
d. By using the @api property to bind record data in a Lightning Web Component.
54.
54.How do you manage security and access to custom objects and fields in Salesforce?
a)
a. By using Page Layouts to hide or display fields.
b)
b. By configuring Field Level Security and Profiles.
c)
c. By writing Apex triggers to restrict data access.
d)
d. By using Visualforce pages to display custom object data.
55.
55.Which tool can be used to debug and troubleshoot Apex code in Salesforce?
a)
a. Debug Logs
b)
b. SOQL Analyzer
c)
c. Data Loader
d)
d. Workflow Rules
56.
56.A custom web component searchOppCriteria helps the sales team search for opportunity records based on selected criteria. It uses the Apex controller method queryOpportunities to return a list of opportunities named oppList. Which is the correct way to return a list of opportunities oppList using the Lightning Web component properties?
a)
a. @import(queryOpportunities, ‘$searchOppCriteria’) oppList;
b)
b. @wire(queryOpportunities, {searchOppCriteria: ‘$searchOppCriteria’}) oppList;
c)
c. @api(queryOpportunities, {searchOppCriteria: ‘$searchOppCriteria’}) oppList;
d)
d. @wire(queryOpportunities, ‘$searchOppCriteria’) oppList
57.
57.What are the different ways a developer can include the SVG file in custom web components?
a)
a. Use SVG as a static resource file.
b)
b. Use CDN to get the new logo from the server using script.
c)
c. Use getter in the web component’s javascript file to include the static resource by importing it.
d)
d. In the HTML template of the web component, reference the getter.
e)
e. Create an SVG file in the aura component and use it directly in the web component.
58.
58.A Lightning Web component has been created, which embeds an analytics dashboard. The sales team would like to use this component on their Org home page. Which “target” property should be added to the configuration file to make it available for the home page?
a)
a. lightning__AppPage
b)
b. lightning__RecordPage
c)
c. lightning__HomePage
d)
d. lightning__page
59.
59. A Lightning Web component uses a lightning message channel named “dataChannel” to send data to other components. This component will publish the data to the channel so that other components can subscribe to this channel. Which is the correct way to import the channel named “dataChannel” on the client-side controller js file?
a)
a. import dataChannel from ‘@Salesforce/messageChannel/dataChannel__c’;
b)
b. export dataChannel from ‘@Salesforce/messageChannel/dataChannel__c’;
c)
c. import dataChannel from ‘@Salesforce/messageChannel/dataChannel’;
d)
d. import dataChannel from ‘@Salesforce/service/dataChannel__c’;
60.
60.What would be the appropriate relationship to use when designing a model where a Custom_Object__c needs to relate to multiple Parent_Object__c records?
a)
a. Master-Detail Relationship
b)
b. Lookup Relationship
c)
c. Many-to-Many Relationship using a Junction Object
d)
d. Hierarchical Relationship
Reset
