Service Cloud: It
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.
ROLLUP
SUMMARY WITH A LOOKUP FIELD - SALESFORCE
1) Master-Detail
Creates a special type of parent-child relationship between this object
(the child, or “detail”) and another object (the parent, or “master”) where:
- The relationship field is required
on all detail records.
- The ownership and sharing of a detail record are determined by the master record.
- When a user deletes the master
record, all detail records are
deleted.
- You can create rollup summary fields on the master record to summarize the detail records.
The relationship field allows users to click on a lookup icon to select
a value from a popup list. The master object is the source of the values in the
list.
2)Lookup
Creates a relationship that links this object to another object. The
relationship field allows users to click on a lookup icon to select a value
from a popup list. The other object is the source of the values in the list.
So let’s say that you know you are
going to want to do a count on the number of child records. The first
thing we should try to do it to create a Master-Detail relationship between the
parent and child object so that we can use the ‘out-of-the-box’ roll-up summary
field to do the count calculation.
But
sometimes a Master-Detail relationship is not allowed. Why would that be?
1) An object may only have two Master-Detail relationships.
2) A standard object cannot be the child/detail
in a Master-Detail
relationship. An example is that you cannot create a Master-Detail
relationship from the Asset object because the Asset cannot be the child in a
Master-Detail relationship.
Let’s have
a specific example. So let’s say you have a classroom object and a desk
object. Normally this would be setup as a Master-Detail relationship so
that we could easily create a roll-up summary field to count the number of
desks in the classroom. But maybe the desk object already has two
Master-Detail fields on it because it is in a relationship with the School and
District objects. Of course you can beg and plead with those who already
used up those two Master-Detail relationships, but let’s assume that
conversation had a quick ‘No’ as the answer. So now you are stuck with
using the lookup object.
How are you
going to get a count of the number of desks in a classroom? It is going
to take some trigger work and a helper class, but it can be done. Here
are your steps..
6. What are Apex Governor Limits?
Governor
limits are runtime limits enforced by the Apex runtime engine. Because Apex
runs in a shared, multitenant environment, the Apex runtime engine strictly
enforces a number of limits to ensure that code does not monopolize shared
resources. Types of limits that Apex enforces are resources like memory,
database resources, number of script statements to avoid infinite loops, and
number of records being processed. If code exceeds a limit, the associated
governor issues a runtime exception.
14.
What are the types of email templates
available in salesforce.com?
·
Text
·
HTML with Letter Head
·
Custom HTML
·
Visual force
16. What is Roll up summary field in
Salesforce?
Roll
up summary field in salesforce calculates the Count, Sum, Min or Max of particular field of any child
record. Thus, we can say that Roll up summary field can only be created
on Master object.
Note : Roll up summary field
can only be defined on the master object.
18.
How many types of the relationship
fields available in Salesforce?
·
Master Detail
·
Many to Many
·
Lookup
·
Hierarchical (It is available
only on User Object, we cannot create this relationship)
19. How to create many to many relationships
between object?
Creating
many to many relationship in salesforce is little tricky. You cannot create
this type of relationship directly. Follow below steps to create this type of
relationship.
·
Create both objects which
should be interlinked.
·
Create one custom object
(also called as junction object), which should have autonumber as unique
identification and create two master relationships for both objects,
no need create tab for this object.
·
Now on both object, add this
field as related list.
Few
important points (Interview Questions of salesforce ):
- One Object can
have only two Master-Detail
relationships.
- If we delete record A (First Master
detail relationship is always primary) – then child record c will be
deleted.
- If we delete record B then in this
case also child record C will be deleted.
- If we delete record c then only C
will be deleted, master record will not be deleted.
- If child C has two
Master record A and B, Where A is primary relation then Child record C will inherit the look and feel of Parent
object A.
20. In Which sequence Trigger and
automation rules run in Salesforce.com
The
following is the order salesforce logic is applied to a record.
1)
Old record loaded from
database (or initialized for new inserts)
2)
New record values overwrite
old values
3)
System Validation Rules
4)
All Apex “before” triggers
(EE / UE only)
5)
Custom Validation Rules
6)
Record saved to database (but
not committed)
7)
Record reloaded from database
8)
All Apex “after” triggers (EE
/ UE only)
9)
Assignment rules
10)
Auto-response rules
11)
Workflow rules
12)
Escalation rules
13)
Parent Rollup Summary
Formula value updated (if present)
14)
Database commit
15)
Post-commit logic (sending
email)
Additional
notes: There is no way to control the order of execution within each
group above
21. If one object in Salesforce have 2 triggers
which runs “before insert”. Is there any way to control the sequence of
execution of these triggers?
Ans
: Salesforce.com has documented that trigger sequence cannot be predefined. As a best practice create
one trigger per object and use comment blocks to separate different logic
blocks. By having all logic in one trigger you may also be able to optimize on
your SOQL queries.
22. How to delete the User from Salesforce?
Ans
: As per now, salesforce does not allow to delete any user, however you
can deactivate the user.
23. How to delete the users data from
Salesforce?
Ans
: To delete the Users Data go to Setup | Administration Setup | Data
Management | Mass Delete Record, from there select the objects like Account,
Lead etc and in criteria select the users name and delete all records of that
user related to particular object.
24. How to restrict the user to see any record,
lets say opportunity?
Ans
: set up opportunity sharing to be private. If both users are admins
or have view all records on opportunity, then that overrides private
sharing.
25. What is the difference between trigger.new
and trigger.old in Apex – SFDC?
Trigger.new
:
Returns
a list of the new versions of the sObject records.
Note
that this sObject list is only available in
insert and
update triggers,
and the records can only be modified in
beforetriggers.
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.
26.
Salesforce provides two WSDL files, what are the differences?
Salesforce provides a WSDL (Web Service Description Language) files. They are called "Enterprise WSDL" and "Partner WSDL". A WSDL is
an XML-document which contains a standardized description on how to communicate
using a web service (the Salesforce API
is exposed as a web service). The WSDL is used by developers to
aid in the creation of Salesforce integration pieces. A typical process
involves using the Development Environment (eg, Eclipse for Java, or Visual
Studio for .Net) to consume the WSDL, and generate classes which are then
referenced in the integration.
The primary differences between the
two WSDL that we provide are:
Enterprise WSDL:
a) The Enterprise WSDL is strongly typed.
b) The Enterprise WSDL is tied (bound) to
a specific configuration of Salesforce (ie. a specific organization's
Salesforce configuration).
c) The Enterprise WSDL changes if
modifications (e.g custom fields or custom objects) are made to an
organization's Salesforce configuration.
For the reasons outlined above,
the Enterprise WSDL is intended primarily for Customers.
Partner WSDL:
a) The Partner WSDL is loosely typed.
b) The Partner WSDL can be used to
reflect against/interrogate any configuration of Salesforce (ie. any
organization's Salesforce configuration).
c) The Partner WSDL is static, and hence
does not change if modifications are made to an organization's Salesforce
configuration.
For the reasons outlined above, the
Partner WSDL is intended primarily for Partners.
To download a WSDL file when logged into Salesforce:
1. Click Setup | Customize | Develop | API
2. Click the link to download the
appropriate WSDL.
3. Save the file locally, giving the file
a ".wsdl" extension.
Enterprise WSDL -
This WSDL document is for customers who want to build an integration with
their Salesforce organization only.It
is strongly typed, which means that it contains objects and fields with
specific data types, such as int and string. Customers who use the enterprise WSDL document
must download and re-consume it whenever their organization makes a change to
its custom objects or fields or whenever they want to use a different version
of the API.
Partner WSDL -
This WSDL document is for customers, partners, and ISVs who want to build an
integration that can work across multiple Salesforce organizations,
regardless of their custom objects or fields. It is loosely typed, which means that you work
with name-value pairs of field names and values instead of specific data
types. The partner WSDL document only needs
to be downloaded and consumed once per version of the API
26. How to restrict any Trigger to fire only once ?
Triggers can fire twice, once
before workflows and once after workflows, this is documented at
“The before and after
triggers fire one more time only if something needs to be updated. If the
fields have already been set to a value, the triggers are not fired again.”
Workaround:
Add a static boolean variable
to a class, and check its value within the affected triggers.
public
class HelperClass {
public
static boolean firstRun = true;
trigger
affectedTrigger on Account (before delete, after delete, after undelete) {
if(Trigger.isBefore){
if(Trigger.isDelete){
if(HelperClass.firstRun){
Trigger.old[0].addError('Before
Account Delete Error');
HelperClass.firstRun=false;
}
}
}
}
28. Where is the option of the report for the
“Custom Object with related object” and what are the condition to generate
related reports?
Ans
:- If the parent object is the standard object provided by the salesforce like
“Account”, “Contact” then the report will be in there section with related
custom object.
If both objects are the custom then the report will be in “Other Reports”
Sections.
Following
are the conditions to get the report of related objects:
Ø On
both the objects, Reports option must be enable.
Ø The
relationship between both of them must be “Master – detail relationship”.
35 How to display error messages in the
visualforce page ?
Ans:
In Apex use below code to create the error message for visualforce.
|
Apexpages.addMessage( new ApexPages.Message
(ApexPages.Severity.ERROR,'Required fields are missing. '));
|
in
Visualforce page add below tag where you want to display the error message.
36 : What is property in Apex? Explain with
advantages.
Ans:
Apex mainly consist of the syntax from the well known programming language
Java. As a practice ofencapsulation in java we declare any variable as
private and then creates the setters and getters for that variable.
private
String name;
public
void setName(String n)
{
name = n;
}
public
String getName()
{
return name;
}
However,
the Apex introduced the new concept of property from language C# as shown
below:
public
String name {get; set;}
As
we can see how simple the code is and instead of using nearly 8 to 11 lines all
done in 1 line only. It will be very useful when lots of member is declared in
Apex class. It has another advantage in “number of lines of code” limit by
salesforce which will drastically reduced.
37
: What is the controller extension ?
Ans:
Any apex class having a public constructor with Custom Controller or Standard
Controller object as a single argument is known as controller extension.
38 : Explain the need or importance of the controller extension.
Ans:
Controller extension is very useful and important concept introduced by the
salesforce recently. It gives the power to programmer to extend the
functionality of existing custom controller or standard controller.
A Visualforce can have a single Custom
controller or standard controller but many controller extensions.
We can say that the custom extension is
the supporter of custom or standard controller.
Consider one example : If there is one controller written and used by the
multiple visualforce pages and one of them needs some extra logic. Then instead
of writing that logic to controller class (Which is used by many visualforce
pages) we can create a controller extension and apply to that page only.
39 :
How to read the parameter value from the URL in Apex?
Ans:
Consider that the parameter name is “RecordType”.
|
String
recordType = Apexpages.currentPage().getParameters().get('RecordType');
|
40.
What is Master Detail relationship and
look up relationship in Salesforce?
Ans:
Master Detail relationship is the Parent child relationship. In which
Master represents Parent and detail represents Child. If Parent is deleted then
Child also gets deleted. Rollup summary fields can only be created on Master
records which will calculate the SUM, AVG, MIN of the Child records.
Look up relationship is something like “has-a” (Containership)
relationship. Where one record has reference to other records. When one record
is deleted then there is no impact on other records.
41.
Can we convert the lookup relationship
to Master Detail relationship?
Ans:
We can convert the lookup relationship to master detail relationship if and
only if all the existing record has valid lookup field.
·
You can convert a look up to
master detail provided if your existing data look ups contain data for all
records,
·
Also you should have
"Allow reparenting' check box checked for that field otherwise you will
find master detail disabled when you try to change the data tyoe to master
detail.
One
of the most advantage using Master-Detail relationship compare to Lookup
relationship is Roll-Up Summary. In Master-Detail relationship, we can
create roll-up summary field in master record to summarize / count data from
child records. I wrote a blog earlier
for Master-Detail relationship.
More items to notice when create roll-up
summary field:
Parent
record is locked
If
you implement approval process with lock record in master object,
user will not able to create new child record if Sharing Setting in
Master-Detail option is Read/Write.
Solution: change the sharing setting to Read Only.
Validation rule on parent record
If user not able to edit parent record
because of validation rule, and you have roll-up summary in parent record, user
will not able to create or edit child record.
Solution: remove roll-up summary
fields.
Can I change field type from Master-Detail to Lookup relationship?
Yes, make sure there is no roll-up
summary fields in parent record, also in Deleted Fields (erase from Deleted
Fields).
Can I change field type from Lookup to Master-Detail relationship?
Yes, all parent record should be not
blank.
43. Can we
create Master Detail relationship on existing records?
Ans:
No. As discussed above, first we have to create the lookup relationship then populate
the value on all existing record and then convert it.
44. How
validation rules executed? is it page layout / Visualforce dependent?
Ans :
The validation rules run at the data model level, so they are not affected by
the UI. Any record that is saved in Salesforce will run through the validation
rules.
45.
What is the difference between database.insert and insert ?
Ans:
insert is the DML statement which is same as databse.insert. However,
database.insert gives more flexibility like rollback, default assignment rules
etc. we can achieve the database.insert behavior in insert by using the method
setOptions(Database.DMLOptions)
Important Difference:
o
If we use the DML statement
(insert), then in bulk operation if error occurs, the execution will stop and
Apex code throws an error which can be handled in try catch block.
o
If DML database methods
(Database.insert) used, then if error occurs the remaining records will be
inserted / updated means partial DML operation will be done.
49.
What is Difference in render, rerender and renderas attributes of visualforce?
Ans :
render – It works like “display”
property of CSS. Used to show or hide element.
rerender – After Ajax which
component should be refreshed – available on
commandlink, commandbutton, actionsupport
etc.
renderas – render page as pdf, doc
and excel.
50. What is Scheduler class
in Apex?
Ans:
The Apex class which is programed to run at pre defined interval.
Class must implement schedulable interface and it contains method
named execute().
There are two ways to invoke schedular :