0% found this document useful (0 votes)
36 views

Sowjanya Interview Questions

The document contains a series of questions and answers related to Salesforce, covering topics such as Apex methods, roles and profiles, permission sets, SOQL queries, sharing rules, trigger best practices, report types, test classes, deployment methods, and relationships. It highlights key concepts and practices necessary for Salesforce development and administration. Additionally, it includes code snippets and explanations for various functionalities within Salesforce.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Sowjanya Interview Questions

The document contains a series of questions and answers related to Salesforce, covering topics such as Apex methods, roles and profiles, permission sets, SOQL queries, sharing rules, trigger best practices, report types, test classes, deployment methods, and relationships. It highlights key concepts and practices necessary for Salesforce development and administration. Additionally, it includes code snippets and explanations for various functionalities within Salesforce.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.Tell Me About Your Self (IT Experience and Salesforce Experience.)?

2.Can you please evaluate your Current Project and Your Role in Current Project.

3.Can we call an Apex method that is not Aura Enabled?


No, we cannot call that apex class which is not having @auraenabled annotation

4. What is the difference between a Role and Profile in Salesforce?

Role Profile

Sets the limitation for what a


Defines data visibility for a
user can do in an
user.
organization.

Defines what user data a


user can see based on the Defines permissions.
hierarchy.

Not mandatory Mandatory to define a profile.

5.What is Permission Sets in Salesforce?


Permission sets are a collection of permissions/settings useful for giving the user access
to numerous functions and tools. Permission sets can be used for various users to
extend their functional access without altering their profiles. So, one can create a
permission set instead of a separate profile every time.
6.Write a SOQL Query to get last modified 5 accounts
SELECT Id, Name, LastModifiedDate FROM Account ORDER BY LastModifiedDate
DESC LIMIT 5
7.What is a Sharing Rule?

The sharing rules are applied when a user wishes to allow access to other users.
8. What is the Trigger Best practices.
One Trigger Per Object
Use Context-Specific Handler Methods
Bulkily Your Code
Avoid SOQL or DML Inside Loops
Use Collections Effectively
Minimize Trigger Logic
Use Trigger Frameworks
Handle Recursion Carefully
Avoid Hardcoding IDs and Values
Handle Bulk DML Operations Efficiently
Use Trigger.new and Trigger.old Appropriately
Test Your Triggers Properly
Consider Governor Limits
Use Exception Handling Wisely
9. What Are Different Kinds of Reports?
Tabular Reports
Summary Reports
Matrix Reports
Joined Reports
10.How can you show a custom error message in trigger?
"In Salesforce, we can show custom error messages within a trigger by using the
addError() method. This method is typically applied when we want to enforce specific
business logic or validation that cannot be handled through declarative tools like
validation rules.
11. Why do we need to write test classes?
Ensure Code Quality: They verify that the code behaves as expected and
handles edge cases.
Prevent Future Bugs: Tests catch issues when modifying existing functionality.
Deployment Requirement: Salesforce requires 75% code coverage to deploy to
production.
Governor Limit Compliance: Test classes ensure the code works within
Salesforce’s limits, especially with bulk data.
Support Refactoring: They make it safer to update or refactor code without
breaking existing functionality.

12.What is minimum coverage for every Apex class and trigger for deployment?
Apex class is 75%
All triggers must have at least some coverage (i.e., not 0%).
13. How to call the Apex class method in JavaScript file?
import myMethod from '@salesforce/apex/MyApexClass.myMethod';
14. What are different ways of deployment in salesforce?

Workbench, Ant Migration Tool, Change Sets, Copado essentials


15. How many types of API’s available in salesforce?
REST API, SOAP API, Bulk API, Streaming API, Metadata API
16. How to get current logged in users id in apex?
Id currentUserId = UserInfo.getUserId();
17. what are the different methods of batch apex class and why use batch apex?
start:
Purpose: This method is called at the beginning of the batch job. It returns a
Database.QueryLocator or an Iterable object that contains the records to be processed.
execute:
Purpose: This method is called for each batch of records returned by the start method. It
processes the records in the batch.

finish:
Purpose: This method is called after all batches have been processed. It can be used to
perform any final operations, such as sending notifications or logging results.

18. Can you edit an apex trigger/ apex class in production environment?
No we can not edit

19.Write a trigger for Last modified 10 accounts related contacts update last name
to “Dummy”.
Public class UpdateContacts
Public Static void updateLastNameToDummy(){
List<Accounts>LastModifiedAccounts=[Select Id , Name FROM Account ORDER BY
lastmodifieddate DESC Limit 10];
List<Contact> relatedContacts=[ SELECT Id,LastName FROM Contact Where AccountId IN
: LastModifiedAccounts ];
For(Contact Contact : relatedContacts){
Contact. LastName=’Dummy’;
}

Update relatedContacts;

}
}

20. What is an Audit Trail?


The Audit Trail function in Salesforce is useful for gaining information or for tracking all
the recent setup changes that the administration has done in the organization. The audit
trail can preserve data for up to six months.
21. Explain the Salesforce dashboard?
In Salesforce, the dashboard is a pictorial representation of the report. 20 reports can be
added to a single dashboard.
22. What happens to master-detail and lookup relationships when a record is
deleted?
In a master-detail relationship, all the details are deleted when the master record is
deleted. However, in a lookup relationship, the child record remains even when the
parent record is deleted.

You might also like