AJ Interview Questions 1
AJ Interview Questions 1
AJ Interview Questions 1
1. 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.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
Email Limits
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.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
It needs to be done first in Developer edition or testing org or in Sandbox org. Then,
to deploy it in production, a user with Author Apex permission must deploy the
triggers and classes using deployment tools.
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.
5. 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}
Visualforce pages are served from a different domain to improve security standards
and block cross site scripting. Take a look at the highlighted portion in the below
Visualforce page:-
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
8. 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.
9. 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:-
HTML with Only Administrators and users having “Edit HTML Templates”
letterhead permissions can create this template based on a letterhead.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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.
The advantage is that earlier, we had to create custom fields to group or segment
certain data.
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.
12. What are the different types of reports available in Salesforce? Can
we mass delete reports in Salesforce?
1. Tabular Simple Excel type tables which provide a list of items with the
reports grand total
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
4. Joined Multiple blocks showing data from different reports based on same
reports or different report types
Another important point to note here is that, only Summary reports and Matrix
reports can be fed as data source for dashboards. Tabular and Joined reports cannot
be used as data source for dashboards.
Can we mass delete reports in Salesforce? Of Course we can mass delete reports in
Salesforce. The option to mass delete reports can be found under Data
Management in Setup .
13. What are the different types of object relations in salesforce? How
can you create them?
You can define master-detail relationships between two custom objects, or between
a custom object and standard object as long as the standard object is the master in
the relationship.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
dependent on both the objects. In simpler words, it will be a child object for both the
master objects.
In a Lookup relationship, even if the parent record is deleted, the child record will
not be deleted.
Yes. You can have a roll-up summary in case of a master-detail relationship. But not
in case of a lookup relationship.
A roll-up summary field is used to display a value in a master record based on the
values of a set of fields in a detail record. The detail record must be related to the
master through a master-detail relationship.
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’.
When such users perform updates, performance issues will be encountered because
of “data skew”. This happens when a single user/ members of a single role own most
of the records for a particular object.
17. 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.
For full sandboxes: Skinny tables are copied to your Full sandbox organizations, as
of the Summer ’15 release.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
19. How to handle comma within a field while uploading using Data
Loader?
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 ”.
21. What are the types of custom settings in Salesforce? What is the
advantage of using custom settings?
There are two types of custom settings in Salesforce: List Custom Settings and
Hierarchy Custom Settings .
List Custom Settings are a type of custom settings that provides a reusable set of
static data that can be accessed across your organization irrespective of user/
profile.
Hierarchy Custom Settings are another type of custom settings that uses built-in
hierarchical logic for “personalizing” settings for specific profiles or users.
22. How many active assignment rules can you have in a lead/ case?
23. What are custom labels in Salesforce? What is the character limit of
custom label?
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.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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
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.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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.
Change Sets
Salesforce Package
29. 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-Mai l and
Auto-Number .
30. How many callouts to external service can be made in a single Apex
transaction?
Governor limits will restrict a single Apex transaction to make a maximum of 100
callouts to an HTTP request or an API call.
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
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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:-
10 webservice Id planId;
11 }
14 //So need to map the Plan class object to Account standard object
16 acct.Name = vPlan.name;
17 acct.AccountNumber = String.valueOf(vPlan.planNumber);
18 insert acct;
19 vPlan.planId=acct.Id;
20 return vPlan;
}}
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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.
4 <apex:form id="theForm">
5 <apex:pageBlockSection >
7 {!a.name}
8 </apex:dataList>
9 </apex:pageBlockSection>
10 <apex:panelGrid columns="2">
11 <apex:commandLink action="{!previous}">Previous</apex:commandlink>
12 <apex:commandLink action="{!next}">Next</apex:commandlink>
13 </apex:panelGrid>
14 </apex:form>
15 </apex:pageBlock>
</apex:page>
To call a controller method (Apex function) from JavaScript, you need to use
actionfunction .
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
Look at the below piece of code to understand how a controller method is called
using actionfunction.
2 <apex: page>
3 <apex:form id ="frm">
6 </apex:form>
7 <script>
8 function JSmethodCallFromAnyAction()
9 {
10 callfromJS();
11 }
</apex:page>
35. 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() .
36. How many records can a select query return? How many records can
a SOSL query return?
37. What is an attribute tag? What is the syntax for including them?
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:
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
2 <apex:component>
7
<h1 style="border:{!borderColor}">
8
<apex:outputText value="{!myValue}"/>
9
</h1>
</apex:component>
38. 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.
39. 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
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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>();
From Setup, enter Flows in the Quick Find box, then select Flows.
From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce
Pages.
For example:
2 </apex:page>
3 <flow:interview name="flowuniquename"/>
<apex:page>
Click Save.
Move all the appropriate profiles from Available Profiles to Enabled Profiles by using
the ‘add’ and ‘remove’ buttons.
Click Save.
Add the Visualforce page to your Force.com app by using a custom button, link, or
Visualforce tab.
Future annotations are used to identify and execute methods asynchronously. If the
method is annotated with “ @future ”, then it will be executed only when Salesforce
has the available resources.
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
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).
Start method :
global (Database.QueryLocator | Iterable<sObject>)
start(Database.BatchableContext bc) {}
Execute method :
global void execute(Database.BatchableContext BC, list<P>){}
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
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
An sObject is any object that can be stored in the Force.com platform database.
Apex allows the use of generic sObject abstract type to represent any object.
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
Only one object can be searched at a Many objects can be searched at a time
time
Can query any type of field Can query only on email, text or phone
Can be used in classes and triggers Can be used in classes, but not triggers
49. What is the difference between public and global class in Apex?
www.ajskilldevelopment.com
Interview Questions AJ Skill Development
Get (getter) method is used to pass values from the controller to the VF page.
Whereas, the set (setter) method is used to set the value back to controller
variable.
www.ajskilldevelopment.com