70 Questions of SF
70 Questions of SF
70 Questions of SF
software life cycle starting from requirement gathering till delivery with minimal
time and team size, without compromising quality through agile as well as scrum
methodologies. Moreover, i have basic knowledge in hybrid app development using
Phonegap.On the area of my projects i am pointing ****** Project name, technology
used, purpose of project*****. As far as my qualification is concerned i secured BE
graduation in Computer Science & Engineering from Bethlahem Institute of
Engineering, karungal KK dist, Tamilnadu, under Anna University, Chennai in 2012.
And a certification in “Android” from CDAC, Trivandrum after my graduation.About
my strengths, I’m flexible and adoptable towards my work and enthusiasm to learn
new things. I’m a hard worker and i work smart. With respect to weakness, shyness
was the one i faced earlier and now i was able to overcome it with confidence and
passion towards work.Thank you for the opportunity, time and concern to know about
me.
Data loss in Salesforce can occur due to accidental deletion, data import
errors, programming mistakes, integration issues, system bugs, user errors
during data migration, API or bulk data operations, and misconfigured data
retention policies. To prevent data loss, implement best practices, such as
regular backups, access controls, validation rules, and testing before
deployment
Triggers and workflows are both automation features in Salesforce, but they
serve different purposes and have distinct functionalities:
Triggers: Triggers are Apex code snippets that execute before or after
specific database-related events (like insert, update, delete, etc.) occur on
records in Salesforce.
Purpose: Triggers allow developers to define custom business logic and
perform complex actions when specific events happen on records, such as
updating related records, enforcing data validation, or sending email
notifications.
Workflows: Workflows are declarative automation tools that let you define
rules and actions to be performed when specific criteria are met on a record.
Purpose: Workflows are primarily used for simple automation tasks and are
more user-friendly than triggers. They allow you to set up automated actions
like field updates, email alerts, task creation, or outbound message delivery
based on certain conditions.
Flexibility: While workflows provide automation without the need for coding,
they have some limitations compared to triggers. They are ideal for
straightforward actions but may not handle complex logic as effectively as
triggers can.
Yes, there are limits on the number of data.com records available for
Salesforce users. Data.com provides access to a database of business-to-
business (B2B) contact and company data that can be used for sales and
marketing purposes.
The number of data.com records that a Salesforce organization can access
depends on the type of Salesforce edition and the Data.com license level.
Static Dashboard:
Static dashboards are useful when you want to provide a consistent view of
data or share specific insights with others without the risk of the information
changing dynamically.
Dynamic Dashboard:
10. What are some things that you can do to prevent governor limits?
Bulkify Code: Write your Apex code to handle bulk data processing
efficiently. Avoid using SOQL queries or DML statements inside loops.
Instead, bulkify your code by processing records in collections, such as
lists and sets.
Use Aggregate Queries: Utilize aggregate functions (e.g., COUNT,
SUM, MAX, MIN) to perform calculations on large data sets, rather
than using loops to calculate them manually.
Avoid Nested Loops: Minimize nested loops in your code, as they can
quickly lead to hitting CPU limits. Aim to use single loops whenever
possible.
Limit Query Results: Use LIMIT clauses in your SOQL queries to
retrieve a specific number of records at a time. This can help manage
heap size and avoid heap limits.
Query Selectively: Make use of indexes and filter your queries
efficiently to reduce the number of records retrieved. Select only the
fields you need, rather than querying all fields.
11. How can you edit apex classes in a production environment?
16. What do you understand about the term fiscal year or economical
year in Salesforce?
In Salesforce, the term “fiscal year” or “financial year” refers to a defined 12-
month period used for financial reporting and accounting purposes. The fiscal
year does not always align with the calendar year (January to December) and
can start on any date based on an organization’s accounting practices or
fiscal cycle.
Basic SOQL Queries: Basic SOQL queries are used to retrieve records from
a single object based on specified criteria. The syntax is straightforward:
Order By and Limit: SOQL allows you to use ORDER BY to sort query
results and LIMIT to limit the number of records returned:
In Salesforce, an audit trail refers to a feature that tracks and logs changes
made to records and setup configuration within the platform. It provides a
historical record of activities and modifications, allowing administrators and
users to review and monitor changes over time. The audit trail helps ensure
data integrity, compliance, and accountability within the Salesforce
environment.
25. What is the junction object and what purpose does it serve?
Junction objects are widely used in Salesforce when dealing with complex
relationships like many-to-many or when you need to store additional
information specific to the relationship between two objects. They provide an
elegant and flexible way to model these types of relationships, ensuring data
accuracy and consistency within the Salesforce platform.
29. Can two users have the same profile? Can two profiles be
assigned to the same user?
Profiles determine the level of access a user can have in a Salesforce org.
As far as the first part of the question is concerned, Yes. One profile can be
assigned to any number of users. Take the example of a Sales or Service
team in a company. The entire team will be assigned the same profile. The
admin can create one profile: Sales Profile, which will have access to the
Leads, Opportunities, Campaigns, Contacts and other objects deemed
necessary by the company.
In this way, many users can be assigned the same profile. In case the team
lead or manager need access to additional records/ objects then it can be
done by assigning permission sets only for those users.
Answering the second part of the question, each user can only be assigned 1
profile.
In Salesforce, it is the Governor Limits which controls how much data or how
many records you can store in the shared databases. Why? Because
Salesforce is based on the concept of multi-tenant architecture. In simpler
words, Salesforce uses a single database to store the data of multiple clients/
customers. The below image will help you relate to this concept.
A sandbox is a copy of the production environment/ org, used for testing and
development purposes. It’s useful because it allows development on Apex
programming without disturbing the production environment.
This way, you can develop the application without any hassle and then
migrate the metadata and data (if applicable) to the production environment.
Doing this in a non-production environment allows developers to freely test
and experiment applications end to end.
Developer
Developer Pro
Partial Copy
Full
No, it is not possible to edit apex classes and triggers directly in production
environment.
However, Visualforce pages can be created and edited in both sandbox and
in production.
Only if the page has to do something unique (different values), it would have
to be developed via Sandbox.
33. What are the different data types that a standard field record
name can have?
A standard field record name can have data type of either auto
number or text field with a limit of 80 chars.
For generating auto numbers, the format needs to be specified while defining
the field and after that for every record that is added, the number will get auto
generated. For example:-
Sr No-{1}
Sr No-{2}
Sr No-{3}
36. What is the use of writing sharing rules? Can you use
sharing rules to restrict data access?
Sharing rules are written to give edit access (public read and write) or public
read only access to certain individuals in Salesforce org. A classic example
is when:- only your managers or superiors need to be given extra credentials
to your records in objects as compared to your peers.
As far as the second part of the question is concerned, the answer is no. We
cannot use sharing rules to restrict data access. It is only used for allowing
greater access to records.
37. What are the different types of email templates that can be
created in Salesforce?
The different types of Email templates are listed in the below table:-
A bucket field lets you group related records together by ranges and
segments, without the use of complex formulas and custom fields. Bucketing
can thus be used to group, filter, or arrange report data. When you create a
bucket field, you need to define multiple categories (buckets) that are used to
group report values.
You can use dynamic dashboards when you want to show user-specific data
of a particular user, such as their personal quotas and sales, or number of
case closures, or leads converted etc.
You can also use a normal/ static dashboard when you want to show regional
or organization-wide data to a set of users, such as a particular region’s sales
number, or a particular support team’s performance on case closures.
In a Lookup relationship, even if the parent record is deleted, the child record
will not be deleted.
There are 4 calculations that you can do using roll-up summary field. You can
count the number of detail records related to a master record. Or, you can
calculate the sum, minimum value, or maximum value of a field in the detail
records.
“Data skew” is a condition which you will encounter when working for a big
client where there are over 10,000 records. When one single user owns that
many records we call that condition ‘ownership data skew’.
45. Explain skinny table. What are the considerations for Skinny
Table?
In Salesforce, skinny tables are used to access frequently used fields and to
avoid joins. This largely improves performance. Skinny tables are highly
effective, so much so that even when the source tables are modified, skinny
tables will be in sync with source tables.
In a Data Loader .CSV, if there is a comma in field content, you will have to
enclose the contents within double quotation marks: ” “.
Time dependent workflow action cannot be create for: “created, and every
time it’s edited”.
50. How many active assignment rules can you have in a lead/
case?
Custom labels are custom text values that can be accessed from Apex
classes or Visualforce pages. The values here can be translated into any
language supported by Salesforce.
Their benefit is that they enable developers to create multilingual applications
which automatically presents information in a user’s native language.
You can create up to 5,000 custom labels for your organization, and they can
be up to 1,000 characters in length.
Role however is not mandatory for every user. The primary function of the
Role/ Role hierarchy is that it allows higher level users in hierarchy get access
to records owned by lower level users in the hierarchy. An example of that is
Sales Managers getting access to records owned by Sales Reps while their
peers do not get access to it.
Lookup fields
Formula fields whose reference spans over other entities
Fields having dynamic date functions like:- TODAY() or NOW()
Software developers from around the world will unanimously agree that
writing code in test classes makes debugging more efficient. Why? That is
because test classes help in creating robust and error-free code be it Apex or
any other programming language. Since Unit tests are powerful in their own
right, Salesforce requires you to write test classes in Apex code.
Why are they so powerful? Because test classes and test methods verify
whether a particular piece of code is working properly or not. If that piece of
code fails, then developers/ testers can accurately locate the test class having
the faulty bug.
Test classes can be determined easily because every test class will be
annotated with @isTest keyword. In fact, if we do not annotate a test class
with @isTest, then it cannot be defined as a test class. Similarly, any method
within a class which has the keyword testMethod, is a test method.
In Salesforce, if you want to deploy your code to production, then you must
make sure that at least 75% of your Apex code is covered by unit tests. And
all these tests must complete successfully.
1. Change Sets
2. Eclipse with Force.com IDE
3. Force.com Migration Tool – ANT/Java based
4. Salesforce Package
H. Integration – Salesforce Interview
Questions
57. What is an external ID in Salesforce? Which all field
data types can be used as external IDs?
An important point to note is that only custom fields can be used as External
IDs. The fields that can be marked as external IDs are: Text, Number, E-Mail
and Auto-Number.
You can expose your Apex class and methods so that external applications
can access your code and your application through the REST architecture.
This is done by defining your Apex class with the @RestResource annotation
to expose it as a REST resource. You can then use global classes and
a WebService callback method.
Invoking a custom Apex REST Web service method always uses system
context. Consequently, the current user’s credentials are not used, and any
user who has access to these methods can use their full power, regardless of
permissions, field-level security, or sharing rules.
Developers who expose methods using the Apex REST annotations should
therefore take care that they are not inadvertently exposing any sensitive
data. Look at the below piece of code for instance:-
Standard controller in Apex, inherits all the standard object properties and
standard button functionality directly. It contains the same functionality and
logic that are used for standard Salesforce pages.
Custom controller is an Apex class that implements all of the logic for a page
without leveraging a standard controller. Custom Controllers are associated
with Visualforce pages through the controller attribute.
1<script>
2function JSmethodCallFromAnyAction()
3{
4callfromJS();
5}
6</apex:page>
63. How to get the UserID of all the currently logged in
users using Apex code?
You can get the ID’s of all the currently logged in users by using this global
function: UserInfo.getUserId().
64. How many records can a select query return? How many
records can a SOSL query return?
Note that you cannot define attributes with names like id or rendered. These
attributes are automatically created for all custom component definitions. The
below piece of code shows the syntax for including them:
1<apex:component>
2 <apex:attribute name="myValue" description="This is the value
3for the component." type="String" required="true"/>
4 <apex:attribute name="borderColor" description="This is color
5for the border." type="String" required="true"/>
6
7</p>
8<p>
9</p>
1<p>
0</p>
1<p>
1</p>
1<h1 style="border:{!borderColor}">
2 <apex:outputText value="{!myValue}"/>
1 </h1>
3<p>
1</p>
4<p>
1</p>
5<p>
1</p>
6<p>
1
7</apex:component>
1
8
1
9
2
0
2
1
2
2
2
3
66. What are the three types of bindings used in Visualforce?
What does each refer to?
Data bindings and Action bindings are the most common and they will be
used in every Visualforce page.
67. What are the different types of collections in Apex? What
are maps in Apex?
Collections are the type of variables which can be used to store multiple
number of records (data).
It is useful because Governor Limits restrict the number of records you can
retrieve per transaction. Hence, collections can be used to store multiple
records in a single variable defined as type collection and by retrieving data in
the form of collections, Governor Limits will be in check. Collections are
similar to how arrays work.
Lists
Maps
Sets
Maps are used to store data in the form of key-value pairs, where each unique
key maps to a single value.
Syntax: Map<String, String> country_city = new Map<String, String>();
1.
2.
a. From Setup, enter Flows in the Quick Find box, then select
Flows.
b. Click the name of the flow.
c. Copy the unique name of the flow.
3.
From Setup, enter Visualforce Pages in the Quick Find box, then
select Visualforce Pages.
4.
5.
6.
7.
Add the <flow:interview> component somewhere between the
<apex:page> tags.
8.
9.
10.
For example:
1</apex:page>
2<flow:interview name="flowuniquename"/>
3<apex:page>
1.
Click Save.
2.
3.
4.
5.
6.
For example, you can use it while making an asynchronous web service
callout to an external service. Whereas without using the annotation, the web
service callout is made from the same thread that is executing the Apex code,
and no additional processing will occur until that callout is complete
(synchronous processing).
1. Start method:
global (Database.QueryLocator | Iterable<sObject>)
start(Database.BatchableContext bc) {}
2. Execute method:
global void execute(Database.BatchableContext BC, list<P>){}
3. Finish method:
global void finish(Database.BatchableContext BC){}
Triger.new is a command which returns the list of records that have been
added recently to the sObjects. To be more precise, those records will be
returned which are yet to be saved to the database. Note that this sObject list
is only available in insert and update triggers, and the records can only be
modified in before triggers.
But just for your information, Trigger.old returns a list of the old versions of the
sObject records. Note that this sObject list is only available in update and
delete triggers.
Primitive types
Collections
sObjects
User-defined types
Built-in Apex types
For example, Vehicle is a generic type and Car, Motor Bike all are concrete
types of Vehicle.
In SFDC, sObject is generic and Account, Opportunity, CustomObject__c are
its concrete type.
SOQL vs SOSL
SOQL (Salesforce Object Query SOSL (Salesforce Object Search
Language) Language)
Only one object can be searched Many objects can be searched at a
at a time time
Can query only on email, text or
Can query any type of field
phone
Can be used in classes and Can be used in classes, but not
triggers triggers
DML Operation can be performed on DML Operation cannot be performed
query results on search results
Returns records Returns fields
76. What is an Apex transaction?