1. Difference
between profiles and roles.
a. Profile – It
is a group/collection of settings and permissions that define what users can
do in Salesforce. For example, the designation of an employee in a company.
Same profile can be assign to many users. There are two types of profile
Standard and Custom.
b. Role – It
controls the level of visibility that users have to an organization data. Example
Sr. Manager, Junior Manager Etc.
In simple term profile dedicate what you can
do at object level where as role determine what you can do with individual
record
2. What is
Record Type?
a. It let
you offer different business process, picklist values, layouts to different
user. For Example for multivendor site if there are different categories like
groceries, food etc then they will have different layout which we can do with
this Record Type.
3. What is
Salesforce architecture?
a. MVC and
multitenant. Multitenant means all users having same database with same
privilege.
4. Difference
between External ID and Unique ID
a.
External ID – It usually refers
ID from external system. If customer has an Oracle Financial System that
they will be linking with Salesforce it will easier for them to refer Oracle
ID.
b. Unique
ID – It prevents you from entering same value again.
6. How you
can manage Record-Level access
a. Access
Level in Record Level Security
i. Public
Read/Write – User can view and edit all record
ii. Public
Read Only - User can view all record but only certain user edit the record
(to whom the access is given
iii. Private – No
user can view or edit that particular object
b. It can
be manage in four ways
i. Organization-wide
defaults determine the baseline level of access for all records of an
object. It should be most restrictive in record level security because other
record level security implementation only grant additional access, they cannot
restrict the access. It is done through Sharing Settings in setup
1. Suppose
if you want to restrict only 1 user among 100 and 99 will have Read/Write
access then also you need to Private the OWD and give additional access by Role
Hierarchy or Sharing rule to other 99 user.
ii. Role
hierarchies give access for users higher in the hierarchy to all records owned
by users below them in the hierarchy. Role hierarchies don’t have to match your
organization chart exactly. Instead, each role in the hierarchy should
represent a level of data access that a user or group of users needs.
iii. Sharing
rules are automatic exceptions to organization-wide defaults for particular
groups of users, so they can get to records they don’t own or can’t normally see. Sharing rules, like role hierarchies, are only
used to give additional users access to records. We should only create Sharing
Rules for the object whose OWD is set to Public Read only or Private because if
it is Public Read/Write then it will have all the access. They can’t be
stricter than your organization-wide default settings. It is of two type
1. Owner
Based Sharing Rule
2. Criteria
Based Sharing Rule
Note : We can't define sharing rules for
child object. Sharing rules for child object are inherited from parent
object in master-detail relationship
iv. Manual
sharing allows owners of particular records to share them with other
users. Although manual sharing isn’t automated like org-wide sharing settings,
role hierarchies, or sharing rules, it can be useful in some situations, such
as when a recruiter going on vacation needs to temporarily assign ownership of
a job application to someone else. We can share the record by Sharing
button but only when Sharing Rule on that object is Read Only or Private.
7. How to
restrict user for certain login access (like Login Time, IP Address etc)
a. You need
to go to Profiles then select the Profile in which you want to give
restriction. Select IP Ranges & Login Hours to give restriction to
people
8. What is
difference between Modify All & Edit and Read & View All
a. View All & Modify All are not
available for Ideas, Pricebooks, Article Types and Products
9. What is Organization
Level Security in Salesforce?
a. Setting
Password Policy
i. To stop
hacker and unauthorised person this policy define complexicity for password
like capital letter, in how many days password expire, invalid login attempt
and logout period(like 15 min, 30 min , 60 min, forever)
b. Restricting
by IP address
i.
We can set the range of IP address so that
only person within organization within IP range can only login (but make sure
IP address is static otherwise admin will also face problem in login)
c. Restricting
the user by Time
i. Suppose
you want to access org only from 9AM to 5PM and from Monday to Friday
d. Restricting
by Email Domain
i. Suppose
the company want to login form particular company domain only and not login
with other domain.
Note : we can do these all by Health Check
tool also
11. What is Object
level security?
In this level of security we prevent user or
group of user from creating, viewing, editing or deleting of records of an
object by setting Permission on that object and setting Profile
For example User A and User B are there and there
is object ABC is there we want User A can only view the Object ABC and User B
can modify, read, delete Object ABC, we can do this by Permission set and
Profile. We will first Profile with same Read functionality and which will have
read only access and now we will create Permission set and on Object setting we
will give access to Modify, Read, Delete and will assign this to User B
12. What is Field
Level Security?
a. It
controls whether a user can see and edit the values for a particular field on
an object. It can be implemented on two level
i. Profiles
ii. Permission
Sets
13. Why
Field Level Security is required if we want to do that Field cannot be sheen to
particular user it can be done through Record Types?
a. Record
Types does not allow the user to see those fields and it is restricted to
Detail and Edit page only but if user see in List View, Search result, Related
List, Visual Force page, Reports it will be visible so we need Field Level
security
14. What is
Email-To-Case & Web-To-Case?
a. Email-To-Case
- It let your customers send inquiries to email addresses that automatically
convert customer emails to cases.
b. Web-To-Case
- Gather customer support requests directly from your company’s website and
automatically generate new cases with Web-to-Case.
15. What is
Web-To-Lead?
a. Using
pre-existing pages on your company's website, you can capture contact and
profile information from users and automatically generate new leads in
salesforce.com, enabling you to respond in real-time to customer requests. Like
Contact Us form in your website
16. What if
user have Object Level Security Read and Record Level Security Read/Write and
also explain vice versa condition
a. If user
have Object Level Security Read and Record Level Security Read/Write then it
will have only Read access and If Object Level Security has Edit Access and
Record Level Security has Read access then user can only read. Here both
combination security works on records. Whichever have most restrictive security
Wins
17. What
will happen to junction object (Object C) if One object (Object A) OWD is
Public Read/Write and Other object (Object B) OWD is Private ?
a. It will
inherit all the access of Primary Object (Say Object A) and ignore the access (Object
B)
18. When to
use Workflow and Process Builder
a. Reason
why we choose workflow instead of Process Builder
i. When to
send Outbond Message
b. Reason
why we choose Process Builder
i. Allow to
control in order the different action and criteria. We can control the
evaluation criteria. Workflow cannot evaluate the order of execution
19. Understanding
Leads, Accounts, Contact, Opportunities, Products, Pricebooks objects in Sales
Cloud
a. Campaign
– It use to store the information of the campaign which we do
marketing, brand building any marketing stuff
b. Lead – It
store the information of potential customer (Like if we sell camera then our
potential customer who is interested in Camera or he is photographer)
c.
Account – It store the
information of customer(individual or company) to whom we are working or
to whom we sell. (Like we sell camera to some Digital Company then its info
will get save in Accounts)
d.
Contacts – It store the
information of individual working in that particular Accounts (Like
there are some key people of some company who is in deal with us. Their info
will get save in Contacts)
e.
Opportunity – It store the
information of Deal that happening or happened. (Like if we are selling
5 Cannon camera to some Digital Company and already sold 10 Nikon to other, all
these info will get save into Opportunity)
f. Products
– It store the information of product or services we are
selling. (Like the information of Camera its model and Lens whatever
stuff will get store in Products)
g. Pricebook
– It store the information of different prices of same products
(Like same camera is selling to company at other price and to other
company at different)
h. Quote – It
store the information of quotation about products or services. We can have
different quotes for single deal.
i. Contract
– It store the information of contract that we have deal with
customer or company
20. Type Of
Sandbox
a. Developer
Sandbox (1 day, 200MB)
b. Developer
Pro Sandbox (1 day, 1GB)
c. Partial
Copy Sandbox (5 days, 5GB)
d. Full
Sandbox (29 days, Same as prod org)
21. Difference
between Account & Contacts
a. Contacts
are individual within a company and account with which you do business. In
order to create contact you need to have an account
22. Can a
checkbox act as controlling field?
a. It can
be possible to make Checkbox as controlling field but not dependent field
a. "Sales
Cloud" refers to the "sales" module in salesforce.com. It includes
Leads, Accounts, Contacts, Contracts, Opportunities, Products,
Pricebooks, Quotes, and Campaigns (limits apply). It includes features such as
Web-to-lead to support online lead capture, with auto-response rules. It is designed
to be a start-to-end setup for the entire sales process; you use this to help
generate revenue.
b. "Service
Cloud" refers to the "service" (as in "customer service")
module in salesforce.com. It includes Accounts, Contacts, Cases, and
Solutions. It also encompasses features such as the Public Knowledge Base,
Web-to-case, Call Center, and the Self-Service Portal, as well as customer
service automation (e.g. escalation rules, assignment rules). It is designed to
allow you to support past, current, and future clients' requests for assistance
with a product, service, billing, etcetra; you use this to help make people
happy.
26. Explain
Governor Limit and why it is introduced in Salesforce?
a. It is
the runtime limit enforced by the Apex runtime engine to ensure the code does
not misbehave. As Salesforce is multitenant environment so there is no bias
with users it is introduced in Salesforce.
i.
|
Item
|
Limit
|
|
ii.
|
-----------
|
||
iii.
|
Custom Fields
|
500
|
|
iv.
|
Rollup Summary Fields
|
25
|
|
v.
|
Custom Relationship Fields
|
40
|
|
vi.
|
Active Workflow Rules
|
50
|
|
vii.
|
Total Workflow Rules
|
500
|
|
viii.
|
Approval Processes
|
500
|
|
ix.
|
Active Lookup Filters
|
5
|
|
x.
|
Active Validation Rules
|
100
|
|
xi.
|
VLOOKUP Functions
|
10
|
|
xii.
|
Sharing Rules (Both Owner- and
Criteria-based) 300
|
||
xiii.
|
Sharing Rules (Criteria-based Only)
|
50
|
|
Description
|
Synchronous
|
Asynchronous
|
|
Limit
|
Limit
|
||
Total number of SOQL queries
issued1
|
100
|
200
|
|
Total number of records
retrieved by SOQL queries
|
50,000
|
||
Total number of records
retrieved
|
10,000
|
||
by Database.getQueryLocator
|
|||
Total number of SOSL queries
issued
|
20
|
||
Total number of records
retrieved by a single SOSL
|
2,000
|
||
query
|
|||
Total number of DML statements
issued2
|
150
|


10,000
|
||
DML statements,
Approval.process,
|
||
or database.emptyRecycleBin
|
||
Total stack depth for any Apex
invocation that
|
16
|
|
recursively fires triggers due
to insert, update,
|
||
or delete statements3
|
||
Total number of callouts (HTTP
requests or Web
|
100
|
|
services calls) in a transaction
|
||
Maximum cumulative timeout for
all callouts (HTTP
|
120 seconds
|
|
requests or Web services calls)
in a transaction
|
||
Maximum number of methods with
|
50
|
|
the future annotation allowed
per Apex invocation
|
||
Maximum number of Apex jobs
added to the queue
|
50
|
|
with System.enqueueJob
|
||
Total number of sendEmail
methods allowed
|
10
|
|
Total heap size4
|
6 MB
|
12 MB
|
Maximum CPU time on the
Salesforce servers5
|
10,000
|
60,000
|
milliseconds
|
milliseconds
|
|
Maximum execution time for each
Apex transaction
|
10 minutes
|
|
Maximum number of push
notification method calls
|
10
|
|
allowed per Apex transaction
|
||
Maximum number of push
notifications that can be
|
2,000
|
|
sent in each push notification
method call
|


27. Difference
between Lookup and Masterdetail
a. Lookup –
Creates a relationship that links two object. When a parent object is
deleted you can configure a child object to either clear the parent record
value in the child or prevent deletion of the parent record.
b. MasterDetail
– Create a special type of parent-child relationship between objects (either
between two custom object or custom and standard object but parent will be
Standard object in this case). When a parent record is deleted all child
records get deleted.
28. What is Rollup
Summary ?
a. A read
only fields that display the SUM, Minium or Maximu value. This is created on
Master Detailed Field. Work only on data type like Number, Currency type field
29. Explain
Various Email Templates
a. Text
b. HTML
with letterhead
d. VisualForce
30. What is
bucket Field in report?
a. A bucket
field is group of related records which is defined by user as per requirement
31. What is
Skinny table?
a. It is
used to store frequently used fields. Limitation are
i. Can have
max 100 column
ii. Fails to
contain field from other table
32. How many
types of reports are there?
a. Four
Types
i. Tabular
ii. Summary
iii. Matrix
iv. Joined
33. What is
Custom Setting?
a. It is
almost similar to custom objects. Application developer can create custom sets of
data and associate custom data for an organization, profile, or specific user.
It get saved in Salesforce org only. There are two types List & Hierarchy
34. What is
Junction object?
a. It is a
custom object with two master detail relationship. It is a key to make Many to
Many relationship between the objects
35. What is
Coarse-Grained & Fine-Grained components?
a. Coarse
Grained – Few objects holds lots of data like <apex:detail>
b. Fine
Grained – More object holds less data like <apex:inputField>
36. What is Validation
rule Name Few ?
a. These
rules helps us to improve data quality by preventing users from entering
incorrect data.
i. REGEX –
compare text Field to regular expression
ii. ISPICKVAL
– Determines if the value of a picklist field is equal to a text literal you
specify
iii. CONTAINS
– compare two arguments of text.
iv. ISCHANGED
– Compares the value of a field to the previous value
v. ISCLONE
– Check if the record is a clone of another record
vi. ISNEW –
check if the formula is during the creation of a new record
vii. INCLUDES
– Determines of any value selected in a multiselct picklist field equals a text
literal you specify
37. Difference
between ISNULL and ISBLANK
a. ISNULL
only supports number field where is ISBLANK support both number and text
38. Explain
Process Builder ? (8 action)
a. It is a
point-and-click tool that let’s you easily automate business process and also
can see the graphical representation of the process we build. We can also
update the child records in process builder. Several actions can trigger the
process builder
ii. Email
Alerts
iii. Trigger
apex code
iv. Post to
chatter
v. Update
records
vi. Call another
process
vii. Launch a
flow
viii. Submit
automatic for the approval
39. Explain
Work Flow?
a. We can
automate business process based on criteria like
i. Send an
Email
ii. Create a
Task
iii. Filed
Updates
iv. Outbond
Message
b. It only
work in masterdetail. In this we can update only parent record.
c. Type Of
Action
i. Immediate
ii. Time
Triggered
d. Salesforce
will evaluate the rule when record is
i. Created
ii. Created,
and every time its edited
iii. Created
and every time its edited to subsequently meet criteria
40. What is Approval
Process?
a. Salesforce
approval process is an automated process and your organization can use to
approve records in Salesforce, An approval process is combination of steps for
a record to be approved and person has to approve it each step.A step can apply
to all the records to that object or just record that meets the certain
criteria. An approval process also specifies the actions to take when a record
is approved, rejected, recalled, or first submitted for approval.
41. What is
VIEWSTATE and How to reduce View State ?
a. It is a
state of your VF page, which help Salesforce to regenerate VF page when it come
back from server. For example when you fill the page and when some required
filled is not filled but you click on save but when the page load it remain
same as it was earlier this is what it done with View State. It has a limit of
135KB.
i. To avoid
exceed limit use less form in single VF page.
ii. Decrease
collection items if it is of no use.
iii. Define
private if it is not used in VF page
iv. Avoid
SOQl queries in your Apex controller getter methods
v. Instead
of using two forms use apex:actionRegion
42. What is
Data loader?
43. Difference
between actionFunction, actionSupport & actionPollar
a. actionFunction
– It call apex method from javascript
b. actionSupport
– it call apex method on some event
c. actionPollar
– for refreshing the component on certain interval of time
44. What are
the bindings in visualforce?
a. Data
Binding – which refer to the data set in the controller.
b. Action
Binding – which refer to action methods in the controller.
c. Component
Bindings - which refer to other Visualforce components.
45. What is
recordSetVar?
a. The
value of the attributes indicates name of the set of records passed to the page
means collection record
46. What is
Pagination in VF ?
a. Breaking
the page into separate pages within salesforce is the pagination
47. What are
the action in VF?
a. actionFunction, actionSupport, actionPolar
a. actionFunction, actionSupport, actionPolar
48. What is
actionRegion?
a. An area
of a Visualforce page that demarcates which components should be processed by
the Force.com server when an AJAX request is generated. Only the components in
the body of the <apex:actionRegion> are processed by the server, thereby
increasing the performance of the page.
49. apex:Repeat
vs apex:DataTable vs apex:PageBlockTable
a. apex:pageBlockTable
represents a table formatted and styled to look like a related list
table.
b. apex:dataTable
is an unstyled table suitable for use anywhere outside of a apex:pageBlock
(but may be used within one)
c. apex:dataList
renders a ul or ol element (unordered or ordered list,
respectively), with li (list item) elements comprising the rows
d. apex:repeat
allows any arbitrary output based on a template.
50. Can we
create dashboard using VF page? What compoenents we use?
a. We can
create Dashboard using VF page but only when it not use StandardController. We
can add up to 20 components
b. The
components we use are <apex:PanelGrid>, <apex:actionSupport>
51. How you
will add an attachment from VF page? Tell the components names to achieve this?
a. By using
<apex:inputFile>
52. Difference
between rendered, reRender and renderAs
a. Rendered
– It’s a Boolean value and the default value is always true, It works
like “display” property of CSS. It is used to place
condition for a component(field, outputpanel, section etc), that will show or
not on page.
b. Rerender
– After Ajax which component should be refreshed. For this we
need to assign ID to field, sections or a block. Its available on
command link, commandbutton, actionSupport etc.
c. RenderAs
– It is used for visualforce page show as PDF, Excel or any
other standard document format.
53. Difference
between controller, Standard Controller and extension
a. Controller
– It is also called custom controller. In this we define
controller in Apex where we can define our own functions
b. StandardController
– It have same functionality we need to use the Standard Object
and custome object function . Like (save, edit, delete, cancel) we use
StandardController in this.
c. Extension
– When we want to use StandardController functionality and also
want to implement own function we use Extension where we write logic in
Apex
54. What are
some Apex Best Practice?
a. https://developer.salesforce.com/page/Apex_Code_Best_Practices
55. What is
sObject?
a. Any
generic object in Salesforce is sObject.
56. What is
Getter and Setter
a. Getter – It
is used to pass data from Apex/Controller to VF page
b. Setter – Is
used to pass data from VF page to Controller
57. What are
all data types in Apex
a. Integer
b. String
c. Date
d. Long
e. Boolean
f. Time
g. Blob –
collection of binary data which is stored as object. We use when we want some
attachment
h. sObject
i. Collection(Map,
List, Set)
58. Explain
some String Method
a. Contains
– Returns true if it contains the given substring
b. Equals –
return true id both string are equal
c. Startwith
– return true if it start with given string
59. Define
collection (Map, Set, List)
a. List – It
is a ordered collection of primitives, user defined objects, sObjects, Apex objects
or other objects. It can be multidimensional to 5 levels. Some methods are
i. size()
ii. remove()
iii. add()
iv. get()
v. clear()
vi. set()
vii. sort()
b. Set – A
set is a collection unique, unordered elements of primitive data types or sObject.
It does not contain duplicate element. You can safely try to add the same
element to a Set more than once and it will just disregard the duplicate
(without throwing an Exception). However, there is a slight twist when dealing
with sObjects. Uniqueness of sObjects is determined by comparing fields in the
objects. The uniqueness is determine by the field values. Some of the methods
are
i. add()
ii. remove()
iii. contains(setElement)
iv. remove(setElement)
v. size()
c. Map – It
is a collection of key value pair. Keys can be any primitive data type while
values can include primitives, Apex objects, sObject and other collection.
i. Map<Integer,
String> M1 = new Map<Integer, String>();
M1.put(1, ‘First Name’);
60. Different
ways for writing collections(List, Set, Map) (Please refer the below link)
a. https://blog.jeffdouglas.com/2011/01/06/fun-with-salesforce-collections/
61. What is
Access Modifiers?
a. Private
– In this methods or variables is access only within the Apex class
b. Public –
In this, methods or variable is access in whole application
c. Global –
In this methods or variables is access outside the application
62. What is
Sharing Model?
a.
With Sharing – If a
class is specified with ‘With Sharing’ keyword then it will restrict the
user to get executed where it have no permission and access. Means all sharing
rule applicable here.
b. Without
Sharing – In this case sharing rule is not applicable. This is the
default sharing mode
Default - Without Sharing
Now, Apex class always execute in system
context i.e. Apex code has access to all objects and fields irrespective of the
logged in User. Example - lets consider you have VF page in which you are
showing certain fields as columns. Lets see one column says "Sales Rep
Performance" which displays a flag in red, green and yellow. Now ideally
this field should not be visible whenever a Sales Rep accesses this page
(consider this as business requirement). But it is always visible if the class
has no keyword specified or if a class has without sharing specified.
Now once the class is "with sharing"
the object permissions, field-level security, sharing rules are applied for the
current user and fields which should not be visible/accessible and not visible
or accessible.
Important –
- if a
method is defined in a class declared with 'with sharing' is called by a class
declared with 'without sharing', the method will execute with sharing rules
enforced.
- The
class doesn’t enforce sharing rules except if it acquires sharing rules from
another class.
Ex. Class A (with sharing) calls a method from
Class B(Without sharing) then complete context is 'with sharing'
- Inner
classes do not inherit the sharing setting from their container class.
63. What is
DML?
a. Data
Manipulation Language – It is used to retrieve, store, modify, insert, update,
and delete data in database
64. Difference
between DML and Database method
a. In DML
partial update is not allowed but it is allowed in Database method.
65. What is
the order of execution when record saved?
a. Old
record loaded from database (or initialized for new inserts)
b. New
record values overwrite old values
c. All Apex
before triggers (EE / UE only)
e. Custom
validation rules
f. Record
saved to database (but not committed)
g. Record
reloaded from database
h. All Apex
after triggers (EE / UE only)
i. Assignment
rules
j. Auto-response
rules
k. Workflow
rules*
l. Escalation
rules
m. Parent
Rollup Summary Formula value updated (if present)
n. Database
commit
o. Post-commit
logic (sending email)
66. What is
SOSL?
a. Salesforce
Object Search Language – Search the text string across the object and across
the field
Example = [FIND ‘ABC*’ IN ALL FIELDS RETURNING
HOTEL_C (ID, HOTEL_C.NAME)];
67. What is
Trigger?
a. It is an
Apex script that executes before or after specific data manipulation language.
There are two types of Triggers
- Before
Triggers – It is applied when we are working on same object. It is used to update
or validate record values before it saved to database
- After
Triggers – Is is applied when we use trigger for other objects. It is
used access value of the record that are stored in the database
68. What is
Bulk Trigger and its advantage?
a. All
triggers are bulk triggers by default. We can say it can process multiple
records at a time.
69. Advantages
of Trigger over Process Builder.
a. Process
Builders cannot handle before DML It executes after a record has been created
or updated. Whereas Apex triggers can handle both before and after DML
operations.
b. Process
Builder cannot handle delete and undelete DML. Whereas Apex triggers can handle
all DML operations.
c. An error
reported in Process Builder is more generic which makes it difficult to find
the origin of the error. With Apex triggers, exception handling can be made
more specific.
d. It is
all or none in case of Process Builder failure. But with Apex triggers partial
success is possible.
70. What is Code
Coverage ?
a. Code
coverage indicates how many executable lines of code in your classes and
triggers have been exercised by test methods.
b. Code
coverage percentage is a calculation of the number of covered lines divided by
the sum of the number of covered lines and uncovered lines.
c. System.debug()
statements and curly brackets are excluded when they appear alone on one line.
71. What is
recursive workflow and recursive trigger. How can we avoid it?
a. Recursive
workflow is re-evaluating the rules on same object again again. To avoid that
use criteria – created, and edited any time it’s edited to
subsequently meet criteria
b. Recursive
Trigger - Recursion occurs when same code is executed again and again. It can
lead to infinite loop and which can result to governor limit sometime. To avoid
recursive trigger in salesforce use Static Variable
72. Types of
Events in Triggers
a. beforeInsert
b. afterInsert
c. beforeUpdate
d. afterUpdate
e. beforeDelete
f. afterDelete
g. afterUndelete
73. Explain
Context Variables in Triggers
a. It allow
developers to access run time context
i. isInsert
ii. isUpdate
iii. isDelete
iv. isBefore
v. isAfter
vi. new
vii. newMap
viii. old
ix. oldMap
x. size
xi. isExecuting
xii. isUndelete
74. What are
Transaction control in Salesforce (SavePoint & Rollback)?
a. Savepoint
specify the state of database at that time so when DML operation occur after
savepoint can be rollback to that point when unsuccessful.
75. Explain
exception in Apex and define some
a. Exception
denotes the error that disrupts the normal flow of code execution. Some are
i. DMLException
ii. Emailexception
iii. LimitException
iv. ListException
v. MathException
b. It can
be handled by Try Catch in apex
76. Can we
define SOQL in constructor ? And can we define DML in constructor
a. Yes we can
define SOQL in constructor but we cannot define DML in constructor
77. What is
Standard Set Controller? Name some of its method
a. StandardSetController
objects allow you to create list controllers similar to, or as extensions of, the pre-built Visualforce list
controllers provided by Salesforce.
List<account> accountList =
[SELECT Name FROM Account LIMIT 20]; ApexPages.StandardSetController ssc = new
ApexPages.StandardSetController(accountList);
78. What is Standard List Controller?
a. Standard
list controllers allow you to create Visualforce pages that can display or act
on a set of records
79. In how
many ways we can call controller from VF page?
a. apex:page
action
b. apex:commandLink
c. apex:commandButton
d. apex:actionFunction
e. apex:actionSupport
81. What is
Offset?
a. When
expecting many records in a query’s results, you can display the results in
multiple pages by using the OFFSET clause on a SOQL query. For example, you can
use OFFSET to display records 51–75 and then jump to displaying records
301–350. Using OFFSET is an efficient way to handle large results sets.
82. What is query limitation and what is offset max value?
a. Total number of records retrieved by SOQL queries 50,000
83. What is
Wrapper Class?
a. It is a
class whose instances are collection of other objects
84. What is
Class?
a. Class is
a blue print from which Objects are created. An object is an instance of class.
(Object is nothing but the real world things which need real data)
85. OOPS in
Apex?
a. Any
language which supports the following concepts are called OOPs based languages.
i. Programming
Elements – Data (Variable) + Instructions(Methods)
b. Encapsulation
– Binding the programming element into single unit.
i. Achieved
by CLASS & INTERFACE.
c. Abstraction
– Hiding the programming elements
i. Achieved
by Access Specifier (Private, Public, Global)
d. Polymorphism
– A single entity existing using many forms. Like + operator
use in Addition as well as concatenate
i. Achieve
by Overriding & Overloading
Overloading
occurs when two or more methods in one class have the same method
name but different parameters.
Overriding means having two methods with
the same method name and parameters
e. Inheritance
– Inheriting the property from parent class to child class. i.
Achieve by EXTENDS
f. Class – It is a
collection of functions, properties, behaviour
g. Methods
– It is nothing just the function and logic we define in class.
87. Synchronization
--------------------------------------------------
Admin
|
Development
|
sObject
|
Class
|
Fields
|
Variable
|
Buttons and links etc
|
Methods & Functions
|
Records
|
Object(Instance Variable of class)
|
Multiple Records
|
Collections(List,Set,Map)
|
88. What is
the difference between non-static and static?
a. By
default all the variables and methods are non-static.Scope of the non-static
variables or methods is within the scope of the same object.
b. We can
declare variables and methods as static by using static keyword. Scope of the
static variables and methods is throughout the transaction. Static variables
and methods, we can directly call with class name (we cannot access static
variables and methods with object name).
89. What is Batch
in Salesforce? Explain flow on batch
a. 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.
b. To write
a Batch Apex class, your class must implement the Database.Batchable interface
and include the following three methods
start
Used to collect the records or objects to be
passed to the interface method execute for processing.
execute
Performs the actual processing for each chunk
or “batch” of data passed to the method.
finish
Used to execute post-processing operations
(for example, sending an email) and is called once after all batches are
processed.
90. Difference
between Async and Sync apex?
a. Synchronous:
In a Synchronous call, the thread will wait until it completes its
tasks before proceeding to next. In a Synchronous call, the code runs in
single thread.
i.
Example – Trigger, Custom Controller, Controller Extensions
b. Asynchronous:
In a Asynchronous call, the thread will not wait until it completes
its tasks before proceeding to next. Instead it proceeds to next leaving
it run in separate thread. In a Asynchronous call, the code runs in multiple
threads which helps to do many tasks as background jobs.
91. What is
Batch default size and max size?
a. Batch
default size is 200 & its Max size is 2000
92. What is
CRON Trigger? Give Example
a. CornTrigger
is an object in salesforce which contains schedule information for a scheduled
job .Basically it hold the CronExpression,NextFireTime,LastFireTime,StartTime
,End Time ,status etc .
b. List<CronTrigger>
jobs = [Select Id, CronJobDetail.Name, State, NextFireTime From CronTrigger
limit 10];
for(CronTrigger job : jobs)
{
System.debug(job);
}
c. You
can only have 100 scheduled Apex jobs at one time.
d. The
maximum number of scheduled Apex executions per a 24-hour period is 250,000 or
the number of user licenses in your organization multiplied by 200, whichever
is greater.
e. “Seconds
Minutes Hours Day_of_month Month Day_of_week optional_year”
93. What is Schedulable batch?
a. To
invoke the apex class at particular time we use Schedular which first
implements the schedulable interface for the class then specify the schedule
using either the schedule apex page or the System.schedule method.
Global
class Sche_AccountDescUpdate implements Schedulable{ Global void execute
(SchedulableContext scMain){
Batch_AccountDescUpdate batchClass = new
Batch_AccountDescUpdate(); ID idBatch = Database.executeBatch(batchClass, 200);
}
}
You cannot release updated versions of any
code that is used by your scheduled job without first deleting your scheduled
job.
94. What is
Future Method (Future annotation)
a. Future
Apex is used to run processes in a separate thread, at a later time when system
resources become available.
b. A future
method runs in the background, asynchronously. You can call a future method for
executing long-running operations. If you want to make the execution of the
apex program to run asynchronously then we make use of future method.When you
specify future , the method executes when Salesforce has available resources.
i. Methods
with the future annotation must be static methods
ii. can only
return a void type
iii. The
specified parameters must be primitive data types, arrays of primitive data
types, or collections of primitive data types
iv. Methods
with the future annotation cannot take sObjects or objects as arguments.
v. You can
invoke future methods the same way you invoke any other method.
However, a future method can’t invoke another
future method
vi. No more
than 50 method calls per Apex invocation
95. Why objetcs
can’t be passed as arguments in Future method?
a. The
reason why objects can’t be passed as arguments to future methods is because
the object can change between the time you call the method and the time that it
actually executes. Remember, future methods are executed when system resources
become available. In this case, the future method may have an old object value
when it actually executes, which can cause all sorts of bad things to happen.
96. What is
the use of Database.stateful in batch class?
a. If your
batch process needs information that is shared across transactions, one
approach is to make the Batch Apex class itself stateful by implementing the
Stateful interface. This instructs Force.com to preserve the values of your
static and instance variables between transactions. In Short if you need to
send a mail to check number of record pass and failed in batch job
counter in that case you can use Stateful batch job.
97. What is
Queueable Apex?
a.
This interface enables you to add jobs to the
queue and monitor them, which is an enhanced way of running your asynchronous
Apex code compared to using future methods.
b. For Apex
processes that run for a long time, such as extensive database operations or
external Web service callouts, you can run them asynchronously by implementing
the Queueable interface and adding a job to the Apex job queue.
public
class AsyncExecutionExample implements Queueable { public void
execute(QueueableContext context) { Account a = new
Account(Name='Acme',Phone='(415');
insert a;
}
}
------------------------------
ID jobID = System.enqueueJob(new
AsyncExecutionExample());
---------------------------------------
98. What is
Test Class?
a.
The Apex testing framework enables you to
write and execute tests for your Apex classes and triggers. Apex unit tests
ensure high quality for your Apex code and let you meet requirements for
deploying Apex.
b. To
deploy your code or package at least 75% of apex code must be covered by tests,
and all those tests must pass.
c. To
access org data, annotate the test method with @isTest(SeeAllData=true).
d. Syntax
of writing Test Class
i. @isTest
static void testName() {
//
code_block
}
ii. static
testMethod void testName() {
// code_block
}
Sample Class
@isTest
private class MyTestClass {
@isTest static void
myTest() {
// code_block
}
}
99. Difference
between System.assertEquals() & System.assert()
a. System.Assert
accepts two parameters, one (mandatory) which is the condition to test for and
the other a message (optional) to display should that condition be false.
b. System.AssertEquals
and System.AssertNotEquals both accepts three parameters; the first two
(mandatory) are the variables that will be tested for in/equality and the third
(optional) is the message to display if the assert results in false.
100.
What is Test Suite?
a. A test
suite is a collection of Apex test classes that you run together
101.
What is System.RunAs ()?
a. The
runAs method ignores user license limits. You can create new users with runAs
even if your organization has no additional user licenses. It only runs in test
methods
102.
How can we prevent to cross the governor limit
from soql query ?
b. For mass
records use batch
103.
Explain Test.setPage ()?
a. Test.setPage()
method in Salesforce is used to set the context to current page, normally used
for testing the Visualforce controller in test classes.
104.
What is StartTest & stopTest?
a. StartTest
- The startTest method marks the point in your test code when your
test actually begins. Any code that executes after the call to startTest
and before stopTest is assigned a new set of governor limits.
b. StopTest
- The stopTest method marks the point in your test code when your test
ends.
105.
Ways to Integrate :-
a. User
Interface – Combine the UIs of two or more apps to create composite apps
with little or no rework on the UI of each individual app. One example is
using force.com Canvas
b. Based on
business logic - It uses Apex Web Services for Inbound and Apex
Callouts for Outbound. It typically handles a scenario where business
logic is spread across several applications to implement the complete
end-to-end business process. An example would be building complex logic on the
data received before committing it into Salesforce
c. Based on
Data - It uses SOAP APIs and REST APIs. It typically handles data synchronization
requirements, where one application in an enterprise acts as the primary source
for a particular business object, like Account.
106.
Different type of Integration
a. SOAP API
– This API is useful to integrate your Salesforce organization data with other
application using SOAP.
b. REST API
- This is useful to access other objects in your Salesforce organization using
REST.
i. GET -
Retrieve data identified by a URL.
ii. POST -
Create a resource or post data to the server.
iii. DELETE -
Delete a resource identified by a URL.
iv. PUT -
Create or replace the resource sent in the request body.
107.
SOAP Method and Process (Diagram)
a. SOAP – Simple
Object Access Protocol
b. REST – Representational
State Transfer
108.
What is Web Service?
a. It is a
code or language for communicating between two application
109.
What is Callouts?
a. An Apex
callout enables you to tightly integrate your Apex with an external service by
making a call to an external Web service or sending a HTTP request from Apex
code and then receiving the response
110.
What is JSON
a. JSON
stands for JavaScript Object Notation. JSON is light weighted than XML
111.
What is Remote Site Settings?
a. Remote
site settings is used to authorize the endpoint and allow us to whom
integrate(end user).
0 Comments