SFDC Interview Questions - Differences
SFDC Interview Questions - Differences
SOQL SOSL
soql stands for salesforce query sosl stands for salesforce search language
language
Need to write different soql against works on multiple objects at same time
diff objects
Soql against same field will be slow All fields are alredy text indexed
can be used in apex classes and Cannot be used in triggers, can be
triggers. used in apex classes anonymous block.
3.Difference between created, and every time it’s edited and created, and any time it’s
edited to subsequently meet criteria in Salesforce
created, and every time it’s edited created, and any time it’s edited to subsequently
meet criteria in Salesforce
Fired whenever the record is created or Fired whenever the record is created or edited and
edited and match the criteria. previously did not meet the criteria and now
matches the criteria.
Time dependent workflow actions cannot Time dependent work flow actions can be created.
be created.
Once the components are installed from an Once the components are installed from a
unmanaged package, the components can be managed package, the components cannot be
edited in the organization they are installed in. edited in the organization they are installed in.
Standard Controller is available for all API entities/objects as well as Custom objects.
Provides access to standard salesforce data and behavior.
Syntax:<apex:page standardcontroller="Account">
Custom Controller:
Custom Controller is an apex class that implements all the logic for a page without
leveraging the functionality of a standard controller.
Are coded to create custom behavior.
Syntax:<apex:page controller="c13">
If you want to use one or more standard objects in apex class, there is only way to use
custom controller.
If you use standard controller or extension controller, by default sharing rule is applicable
,so at that time only way is custom controller.
Extension Controller:
Any apex class having a public constructor with custom controller or standard controller
object as a single argument is known as controller extension.
It is an apex class which adds functionality to existing standard and custom controllers.
A visualforce Page can have multiple controller extensions, but only one standard or
custom controller.
syntax:<apex: page standardcontroller="account" extension="hani143">
7.Difference Between Trigger.New and Trigger.newMap in Apex?
Trigger.New Trigger.newMap
Returns a list of the new versions of the Returns a map of IDs to the new versions of the
sObject records sObject records.
Note that this sObject list is only available Note that this map is only available in before
in insert and update triggers, and the update, after insert, and after update triggers.
records can only be modified in before
triggers.
Trigger.newMap dont work for before insert Trigger.New works fine for holding all Ids of
while records while inserting.
Trigger.new returns a list, which are ordered Trigger.newMap returns a map - which are
unordered.
it send many mails when ever criteria matches Sends one email based on the first rule entry
criteria it matches in a sequence of rule
entries.
Role helps in opening the records to the Profile helps to put restrictions on the
users above the Role hierarchy Object
ISBLANK:
•Determines if an expression has a value and returns TRUE if it does not. If it contains a value,
this function returns FALSE.
•Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as
ISNULL, but also supports text fields. Salesforce.com will continue to support ISNULL, so you
do not need to change any existing formulas.
•A field is not empty if it contains a character, blank space, or zero. For example, a field that
contains a space inserted with the spacebar is not empty.
•Use the BLANKVALUE function to return a specified string if the field does not have a value;
use the ISBLANK function if you only want to check if the field has a value.
•If you use this function with a numeric field, the function only returns TRUE if the field has no
value and is not configured to treat blank fields as zeroes.
17. Differences between the Import Wizard and the Apex Data Loader
Salesforce CRM provides two tools for data migration—the Import Wizard and the Apex Data
Loader.
The Import Wizard
is designed for less-technical users and smaller, simple imports of up to 50,000 records. It takes
you through the process step by step and displays error messages to alert you to potential record
duplications ("dupes"). For more information, go to Help & Training | Importing Data | Using the
Import Wizards.
Use the Apex Data Loader
for complex imports of any size. It's for technical users only. You'll need access to the API to use
this tool, which is included with Enterprise and Unlimited Edition. If you have another edition,
you can purchase the API separately by contacting your account executive. The Data Loader
doesn't display error messages to alert you to potential problems. However, this tool includes
several features that help make large data imports easier, such as being able to save your
mappings. For more information, go to Help & Training | Data Loader.
The table below summarizes the difference between the two tools. The instructions in the
remaining steps refer to the Import Wizard.
18. Difference In Between Apex PageMessage, PageMessages and Message VF Pages Tags in
Salesforce?
Most of the times on submission of page errors will be there and for showing those error
messages different message tags are there in Visualforce Page Reference guide and first time they
all are gave a feel that they all are same but some minor differences are there among them and
those differences are as given below:-
Apex:PageMessages
apex:PageMessages is a containing component where any messages that have been added to the
page will appear.
Apex:PageMessage
apex:pageMessage is a component that adds a single message to the page.
Apex:Message
apex:message allows you to associate a message with a component.
Notes
ApexPages.Message is the class that is used to model a message. A message isn't associated with
a page until it is added via the ApexPages class.
ApexPages is a class that allows you to access the current page (through
pexPages.CurrentPage()) and manage messages for the current page.
As Shown below messages can be of Error type and Custom Type and generally
Apex:PageMessages tag comes in use for showing all the messages.
19. What is difference between WhoId and WhatId in the Data Model of Task ?
WhoID refers to people things. So that would be typically a Lead ID or a Contact ID
WhatID refers to object type things. That would typically be an Account ID or an Opportunity ID
21. Difference between Profile, OWD or a Sharing Rule?
Profile: Profile is used for object level access. It is used to provide CRUD(Create, Read, Update
and Delete) permission.
OWD: OWD is used for record level access for all the users across Organization. It is used to
provide Public Read Only, Public Read/Write, Private, Public Read/Write/Transfer (Lead and
Case Objects alone).
Sharing Rule: Sharing Rules is used to extend Role Hierarchy.
Important Difference:
· 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.
· 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.
25. What is the difference between the global and public access modifier keywords?
We have different access modifiers like global, private, public.If we use the access modifier as
Global, it can be used anywhere in the org. Generally, Global is used for web-services since one
class needs to handle some other parts of apex in the org.Whenever we use Public keyword, then
the access is limited to the particular class and cannot be used outside the related class.
@RemoteAction apex:actionFunction
@RemoteAction methods are static, and apex:actionFunction methods are instance methods,
therefore can't see the current page state and so can see the entire page state.
directly
@RemoteAction methods require less apex:actionFunction has to transfer the page view
bandwidth, and server processing time, state.
because only the data you submit is visible
and the view state is not transferred,
@RemoteAction methods have to update the apex:actionFunction methods automatically update
DOM manually using explicit JavaScript the Visualforce DOM and can refresh part or all of
the page, and can provide a standard interface for
showing a loading status through apex:actionStatus.
@RemoteAction methods can return data apex:actionFunction methods can update the page's
directly back to the calling JavaScript, but view state and DOM structure, but cannot return
cannot update the page's view state data directly back to JavaScript (although you can
do this with some extra effort using oncomplete).
DataTable:
1.No need to write inside pageblock or pageblocksection.
2.There is no required value.
3.The data can be displayed using custom style sheets.
4.We need to specify column headers explicitly.
5.
Repeater:
1.There is no proper alignment of data in repeater compared with DataTable.
31. what is the difference between input field and input text?
Input field:
An HTML input element for a value that corresponds to a field on a Salesforce object. The <
apex:inputField > component respects the attributes of the associated field, including whether the
field is required or unique, and the user interface widget to display to get input from the user. For
example, if the specified < apex:inputField > component is a date field, a calendar input widget is
displayed. When used in an < apex:pageBlockSection >, < apex:inputField > tags always display
with their corresponding output label. - from component reference
In simple language - It's the field on the object and you can have any data type, which
users can input . Example Picklist, look up, check box and / or multi select picklist etc......
Input text:
An HTML input element of type text. Use this component to get user input for a controller
method that does not correspond to a field on a Salesforce object.
This component does not use Salesforce styling. Also, since it does not correspond to a field, or
any other data on an object, custom code is required to use the value the user inputs. - from
component reference.
This is a field on the object which is of data type Text . Users can use to input only text
using this field.
You cannot use this for picklists , check boxes or any other data type.
Apex:outputLink
A link to a URL. apex:outputLink component is rendered in HTML as an anchor tag with an href
attribute. Like its HTML equivalent, the body of an <apex:outputLink> is the text or image that
displays as the link. To add query string parameters to a link, use nested <apex:param>
components.
See also: <apex:commandLink>
Example
<apex:outputLink value="https://www.salesforce.com"
id="theLink">www.salesforce.com</apex:outputLink>
HTML Output:
<a id="theLink" name="theLink" href="https://www.salesforce.com">www.salesforce.com</a>
You can copy your live instance to a You have to perform manually from sandbox to
sandbox environment. developer edition.
Standard Wizard
• The standard wizard is useful for complex approval processes.
• Use it when you want to fine tune the steps in your approval process.
• The standard wizard consists of a setup wizard that allows you to define your process and
another setup wizard that allows you to define each step in the process.
Iterable<sObject>:
Governor limits will be enforced. So, we can use upto 50,000 records only. Else, exception will
be thrown.
You can also use the iterable to create your own custom process for iterating through the list.
40. What is the difference between Validation rule and roll-up summary fields?
http://infallibletechie.blogspot.com/2012/09/roll-up-summary-field.html