Professional Documents
Culture Documents
We should not modify the live application directly so we work in different environment for the
changes of the existing application.
1. What is Cloud Computing ?
With this approach everything can be done in internet (Using Application, Developing
Application and distributing the hardware),no need of any minimum hardware
requirements and no need to install any software in local system.
3. What is Production?
We should not make coding changes in production since end-users are using the application from
production environment.
5. What is sandbox?
To make any changes for the exiting application we should copy all contents of the production
into sandbox and make all changes after that test thoroughly after that move those changes into
production.
To create the sandbox, in production we can find one link called sandboxes. by clicking on that
link we can create the sandbox by choosing type of the sandbox.
If we refresh all the sandbox contents will be replaced with production contents
11.
What is Full copy sandbox?
Copy both configuration and entire real time data from the production
Customization
1. What is Track Field History?
If, we enable Track Field History user can see Set History Tracking button under
Custom Fields & Relationships section which is available on the object detail page.
By clicking on Set History Tracking button, we can enable tracking for the fields which
ever we want.
To see the object history, go to objects record layout and addObject NameHistory related
list to the layout.
Whenever, user changes field value from one value to another value, it will show the
history of the field in ObjectHistory related list.
To create the Activities, while creating the object, we should check for Allow Activities check
box then user can add open Activities and Activity History related lists on the Object layout.
There are two types of activities
1. Task:Task is nothing but work assigned to a particular person, it doesnt have certain
time limit.
2. Event:It has certain time limit in that time only all persons should assemble after the time
limit over, event will get complete.
Once event or task status changed to Completed then we can see those records under Activity
History Related List.
ISNULL() works only for number data type fieds, if we dont populate with value for
number fields it will return true.
ISNULL() wont support TEXT data type fields because text fields never become null.
We can use checkbox data type fields also while creating dependent picklist (Note:
Checkbox should be always controlling field)
We can use multi-select data type fields also while creating dependent picklist (Note:
multi-select data type field should be always dependent field)
View It is the user interface (Apps, Tabs, Page Layouts, Fields and Record Types)
Controller Business Logic (Save, Edit, New, Cancel and Delete upon click on these
button salesforce execute some logic from controller)
Model It is the Database, which stores Schema (Meta-Data(Data about Data) > Apps,
Tabs, sObjects, fields, Apex Classes, Visualforce pages, etc) and Instance (Records)
In Salesforce, whenever user create any component (Object, field, tab etc) or record
then salesforce will generate an unique id with which user can identify the record or
component.
After creating the record, in the URL user can see the id of the record which is of 15
digits length.
If the user query the existing records from the database through API (Either from Query
Tool or from a program), it will always return18 digitid which is Case-Insensitive.
Last 3 digitsof the 18 digit represents checksum of the capitalization of 15 digit id.
Based on thefirst 3 digits user can identify the object of the record.
All the records belongs to same object will contain same firt 3 digits.
9.
What is Record Type?
For an object based on the Record Type, we can show different fields and different
picklist values by assigning different page layouts for the record types and profiles.
After creating the record type, on the record type detail page user can see all the picklist
data type fields, user can edit the picklist and decide which values should display for this
particular record type.
10. What is the difference between detail page and edit page?
Whenever user try to create a new record or edit an existing record user can input the
values for the fields, this page is nothing but edit page.
After creating a new record or editing an existing record, user can see the information of
the record, this page is nothing but detail page.
14. There are two fields, if the user populate two field values if we combine those
values uniqueness should be maintain, how to achieve this without coding?
Using vlookup function in the validation rule we can achieve this.
15. What are Governor Limits?
Since we are working in multitenant environment Salesforce is enforcing the limits for all the
functionalities.
How many external ids we can enable for an object: 7 (increased from 3 to 7 in Winter15)
To show multiple fields for the records which display under a tab, on object detail page >
under Search layouts edittab and add required fields.
To show multiple fields for the records which display when we click on lookup of a field,
on object detail page > under Search layouts edit Lookup Dialogs and add required fields.
To show multiple fields for the records which display when we search for the records, on
object detail page > under Search layouts edit Search Results and add required fields.
Without selecting the lead process we cant create the record type for lead object
Without selecting the sales process we cant create the record type for opportunity object
Without selecting the support process we cant create the record type for case object
queue). Later users who are part of that queue can claim the ownership by navigating to list view
corresponding to the queue. In that list view users who are part of the queue can select the record
and click on accept button so that record ownership will be transferred from queue to accepted
person.
Questions on Relationships
To avoid Data Redundency and To achieve Integrity we should go for Relationships.
1. Is it possible to create the Master Detail Relationship field for the child
object which is having existing records?
No, we cannot create directly. To create first we should create Look up relationship then populate
the field value for all the records and then convert the look up relationship to master detail
relationship.
If the parent objects dont have Roll up Summary fields for the child object then we can
delete.
To delete a child object it should not be referred in Apex Classes and Apex Triggers.
Later if we undelete the object, Master detail fields on the junction objects will be
converted to look up Fields.
Note:
If we delete only Master Detail Relationship field from the child object and undelete it
from the Recycle Bin then it will be converted to look up relationship.
Parent Object we cannot delete because it will be referred in the child object.
Note:
Salesforce store deleted records only for 15 day in Recycle bin later it will remove the
records permanently.
If we undelete the IT department record from the Recycle bin then all the related child
records department field value will be restored.
6. What will happen to child records if we delete a parent record in case of Master
Detail Relationship?
If we delete the parent object record all the child object records will be get deleted.
Example:
Child Object: Employee (Employee object have Department field which is related to Department
Object)
Master Object: Department
Note:
Salesforce store deleted records only for 15 day in Recycle bin later it will remove the
records permanently.
If we undelete the IT department record from the Recycle bin then along with IT
department record all the related child (Employee) records will be restored. (We cannot
see the child object records in the Recycle bin)
Note: From the above example we can say Employee Object as Junction Object.
8. For a junction object if we delete one of the parent record what will happen to child
records?
Child records will be get deleted which are related to Department as well as Project.
Note: If we undelete the IT department record from the Recycle bin then along with IT
department record all the related child (Employee) records will be restored those will be reflected
for Project as well. (We cannot see the child object records in the Recycle bin)
Profile deals with CRED (Create, Read, Edit and Delete) permissions over Apps, Tabs,
sObjects, Fields, Record Types, etc
We can map only one profile for one user and without mapping the profile we cannot
create the user.
To improve the permissions for the users over profiles we should go for Permission Sets.
Example- To give additional permissions to few users who belongs to different profiles
over Apps, Tabs, sObjects and fields.
6. How to give permissions to two fields for different users who belongs to
different profiles?
Permission sets.
9. What is role?
Role deals with authorization to access data.
10.
What is OWD?
OWD is the default access level on records for any object in sales force.
For custom objects we can see below access levels
1. Private
2. Public Read only
3. Public Read/Write
By default after creating custom object OWD access level is Public Read/Write.
Private: only owner and above hierarchy users can have Read/Write access and below hierarchy
users dont have any access.
Public Read only: only owner and above hierarchy users can have Read/Write access and below
hierarchy users can have only Read Only.
Public Read/Write: Irrespective of role hierarchy every one can have Read/Write permissions
on the records.
11. What is Grant Access Using Hierarchies?
Say there are three roles
Role A
o Role B
Role C
In import wizard we cant see few objects (ex: if there is masterdetail relationship
between two objects then child object we cant see).
.SDL
1. While creating the record criteria meets so that workflow will fire and while editing the
record again criteria meets workflow wont fire (meeting the criteria to meeting the
criteria)
2. While creating the record criteria doesnt meet so workflow wont fire and while editing
the record workflow criteria meets then workflow will fire (not meeting the criteria to
meeting the criteria)
Conclusion: Previous state of record should be not meeting criteria and current state of record
should be meeting the criteria then only in current state workflow will fire.
3. What are the types of rule criterias?
4. Criteria meet (field operator value, if there are multiple criterias then in filter criteria
we can give conditions like ( 1 or 2) and 3, field to field comparison is not possible, we
cant fetch the previous state information of the field )
5. Formula evaluated (we can write formulas with this we can do field to field comparison
and we can fetch previous state value of the record)
12.
What are the types of email templates?
13. Text
14. HTML (with letter head)
15. Custom HTML (without letter head)
16. Visual Force
9. There is a time based workflow which will update one of the fields if the
criteria meet. User submits the record with valid criteria, workflow triggered so
that the field update is queued in the time based flow queue which will fire after
one day. If the user modifies the record which is submitted before the scheduled
date, after modification, a record criterion is not meeting. Whether the field will
be updated or not in schedule date?
It wont trigger in the schedule date because if we modify the record to not meeting criteria that
queued field update will be removed from the time based flow queue.
10. For the same scenario explained in the above question what happens when we
deactivate or modify the criteria of the workflow to different criteria? Whether
the field will be updated or not in schedule date?
Yes, It will trigger in scheduled date
11. Scenario: There are two workflow rules on the same object say namely wf1
and wf2. If wf1 fires then a field will be updated on the same object, if the field
updated and due to this wf2 criteria meets then what will happen, wf2 will fire or
not?
It wont fire. To fire wf2 we should enable Re-evaluate Workflow Rules checkbox of the field
update which is there in wf1.
12. What is recursive workflow rule? How to avoid recursive workflow rules?
Whenever we enable Re-evaluate Workflow Rules after Field Changecheckbox in the Field
Update of a workflow rule, due to this field update other workflow rules on the same object will
be fired if the entery criteria of those workflow rules satisfied.
Incase, in other workflow rules also if we enable Re-evaluate Workflow Rules after Field
Change checkbox in the Field Update recursive workflow rules will come in some scenarios.
We can take two steps to avoid recursive workflow rules
1. For the workflowEvaluation Criteria if you choose created, and any time its edited to
subsequently meet criteria option, we can avoid recursive workflow rules.
2. If you dont enableRe-evaluate Workflow Rules after Field Changecheckbox in
the Field Update of a workflow rule we can avoid.
12. Recall approval actions ( After submitting record for approval if you want to revoke we
click on recall approval action on the detail page, after clicking on that button actions
which are under recall approval actions section will be triggered )
15. Scenario: After activating the approval process, I want to add one more step.
Is it possible?
Its not possible, to add one more step deactivate the approval process and clone the deactivated
approval process and add the new steps.
1. What is Report?
To summarize the information of an object we use reports.
2. What are the types of Reports?
3. Tabular (Displays records just like a table)
4. Summary (we can summarize the information based on certain fields)
5. Matrix (we can summarize the information in two dimensional manner, both rows and
columns)
6. Join (we can summarize information in different blocks on the same object and the
related objects)
4. How many maximum groupings we can do for summary, matrix and join
reports?
3 groupings
Set
Set is unordered.
Set doesnt allow
duplicates.
Set elements cannot be
accessed with index.
sort method is not available
for Set.
Contains method is
Contains method is not available available for Set to search
in List.
for a particular element in
the set.
We can process records which
We cannot process
are stored in list using DML
recordswhich are stored in
statements(insert, update, delete
set usingDML statements.
and undelete).
3. What is the maximum size of the list?
No limit for the size of a list. It only depends on the heap size which is 6 MB (Synchronous) and
12 MB (Asynchronous).
4. What are the map methods available in Apex?
5. keyset():To fetch only keys from the map.
Group grp = [select Id, Name from Group where Name = MyQueue and Type = Queue Limit
1];
Apex Triggers
After
after insert
after update
after delete
after undelete
after insert
before
update
after
update
before
delete
after delete
after
undelete
Read/Write NA
NA
Read Only
Read Only
Read Only
Read Only
Read Only
2. If you are updating any field on the same object on which you are writing the trigger and
no need to explicitly include the DML statemetns (already due to DML operation only
trigger fire and it is still in progress at this point of time.)
After Triggers
1. If you are dealing with relationship records and if you need record id in these situations
we should use after trigger (in before insert record doesnt contain the record id).
6. For the same event if there are multiple triggers on the object, how to control
the order of execution?
We cannot control the order of execution in this situation. It is recommended to have only
one trigger per one object.
Note: We can keep the logic of the apex trigger in an apex class and can invoke from that class.
/*
1. Following future method execute asynchronously (whenever server is free it will execute
in future context).
2. We should not declare @future method in Apex Trigger.
3. @future method should be always static.
4. @future method accepts only primitive data types (Integer, String, Boolean, Date, etc)
as parameters and it wont accept
non-primitive data types (sObject,Custom Objects and standard Objects etc.. ) as parameters.
5. @future method should not contain return type. Always it should be void.
6. From an apex trigger we can make only make asynchronous call outs. To make call out
we should include callout = true beside the future @annotation.
7. We cannot perform synchronous call outs from Apex Trigger.
*/
//Below is the example for the future method
@future(callout = true)
public static void processAsync(primitive parameters) {
//Logic to insert/update the standard/custom object.
}
}
9. Following Custom Objects are available in the organization
10. ChildObject__c
11. ParentObject__c
Click to see the full question.
Relationship between ChildObject__c and ParentObject__c objects is Lookup relationship.
In case of lookup relationship if we delete the parent object record in child object only the
relationship field value will be removed (child records wont be deleted).
But client has a requirement to delete the child object records. How to achieve this?
Write an apex trigger to achieve this functionality.
We should take before delete event. If we take after delete relationship will broke up b/w parent
and child object records.
?
Trigger ParentTrigger on ParentObject__c(before delete) {
/*
Note:
For delete events only trigger.old and triggger.oldMap will be available.
trigger.old holds old versions of the records but if we mention that in SOQL query salesforce
will automatically convert those records into ids.
*/
List<childobject__c> childLst = [select id, Parent_Object__c from ChildObject__c where
Parent_Object__c in: trigger.old];
delete childLst;
}
</childobject__c>
10. What is the order of execution in salesforce?
We are creating validation rules, workflow rules, assignment rules, auto-responsive rules,
escalation ruels and apex triggers etc..
If the condition is same for all the rules which will execute first and which will execute next, for
this salesforce provide the order.
Order of execution in salesforce Order of execution in Salesforce:
1. Prepare the record for insert/update operation.
2. It will replace all the old field values with new field values.
3. If the request is coming form UI all the system validations will execute
o DataType
o Length
o Required
o unique
o pageLayot level validations
4. before triggers
5. Custom Validations and again system validation rules will fire (pageLayot level
validations wont fire at this point of time).
6. record will be saved into the database but doesnt not commit.
7. after triggers.
8. assignment rules.
9. auto-responsive rules.
10. Workflow Rules
11. incase of Workflow Rule Field updates again before triggers and after triggers fire one
more time. System validation ruels for duplicate chcek.
12. Escalatoin Rules.
13. Rollup-Summary fields will be calculated.
14. Grant parent Rollup-Summary fields will be calculated.
15. Criteria base sharing evaluation.
16. Record will be commited into the database.
17. Post Commit logic (Sending emails).
11. There is a validation rule which will fire if amount = 100 and will display the
error message. There is a workflow rule which will fire if amount > 100 and will
update amount field to 100. One of user saved the record by giving value as 1000.
what will the value of the amount field.
Validation rules will fire first then workflow rules will fire. So, the answer is 100 (Even though
there is a validation rule because of the workflow rule it will accept 100 in the amount field).
12. There is a before trigger which will fire if amount = 100 and will display the
error message. There is a workflow rule which will fire if amount > 100 and will
update amount field to 100. One of user saved the record by giving value as 1000.
what will the value of the amount field.
It will throw the validation error because after the workflow field update before triggers fire one
more time.
1. What is Batch Apex?
We can call the apex code by creating object for the class (or) if the variables or methods are
static then we can call with class name.
Apex Code in the trigger will execute automatically for the DML operations.
If you want to execute apex code on a specific time then we should write batch class.
3. finish:We can perform post commit logic like sending emails with the success or error
information. It will execute only one time.
10. Is it possible to write batch class and schedulable class in a same class?
By implementing Database.Batchable and Schedulable interfaces we can implement the
methods in a same class.
Though it is possible it is not recommended to write like this.
Test Classes
1. What is the purpose of writing the test class?
After developing an apex class or apex trigger we should write the unit tests and ensure that we
are able to execute at least 75% of the lines of code.
If you are moving the code from sandbox to sandbox regarding code coverage you wont face
any issue.
If you are moving the code from sandbox to production, you need to include all the test classes
at the time of deployment and Salesforce will run all the test classes which you included for the
deployment as well as test classes which are already present in production, if the code coverage
is less than 75%deployment will fail.
we cannot write test code (test methods) inside of the apex trigger.
From API Version 28.0, we cannot write the test methods inside of an apex class which is not
decorated with @isTest.
We can write test methods only in a class which is decorated with @isTest.
Note: We have a governor limit for the overall Apex Code size of the organization which is of 3
MB. If we decorate a class with @isTest annotation Apex Code Size governor limit will be
bypassed.
3. Syntax of testMethod?
?
1
2
@isTest
3
private class MyTestClass {
4
static testMethod void myTest1() {
5
}
6
static testMethod void myTest2() {
7
}
8
}
9
10
Note: Test Class can be either public or private.
4. What is the purpose of seeAllData?
By default test class cannot recognize the existing data in the database.
if you mention @isTest(seeAllData = true) then test class can recognize the existing data in the
database.
See the below examples
From aList Custom Settings we cannot fetch the existing data without seeAllData = true
in test class.
Suppose you have a custom object called CustomObject__c and it contains many
records, we cannot fetch the existing data without seeAllData = true in test class.
Note: It is not recommended to use seeAllData = true for a test class. Based on the existing data
in database code coverage will impact.
1.
Previously Visualforce Pages were not there, instead S-Controls were there.
S-controls have been superseded by Visualforce pages. Organizations that havent previously
used s-controls cant create them. Existing s-controls are unaffected, and can still be edited.
S-controls: It is a combination of HTML and java script but with this to achieve saelsforce look
and feel, it is very difficult and consume lot of tags.
Visualforce: With visualforce we can easily achieve the salesforce look and feel by consuming
very few tags.
Browsers (IE, Chrome, Firefox, etc) can understand only HTML, Visualforce will be
converted to HTML before display on the browser by salesforce.
Visualforce page should start with the following syntax
?
1
<apex:page>
<! You can HTML code here along with using apex tags >
</apex:page>
2. What is the difference between system mode (system context) and user mode (user
context)?
Default Mode
System Mode
System Mode
User Mode
System Mode
User Mode
System Mode
User Mode
Note: to apply security for Apex Class, we can use with sharing while declaring the class. With
sharing will apply only Record-level security. It wont apply Object-level and Field-level
security.
3. What are the types of controllers available for the visualforce page?
There are the two types of controllers
1. Standard Controller
2. Custom Controller
Note: on a visualforce page, we can use either standardController (attribute name for Standard
Controller) or controller (attribute name for Custom Controller). We cannot refer both at a time.
StandardController
We can refer any standard object or custom object in this attribute. At a time we can refer
only one object and we cannot refer apex class in this attribute.
controller
We can refer any apex class in this attribute. At a time we can refer only one apex class in
this attribute.
There is no such attribute called standard list controller but in the standardController page
if you mentionrecordsetVar attribute then that page we can call it as standard list
controller page.
InrecordsetVar attribute we can give any name which will hold the list of records of the
object which we mentioned for the standardController.
There is no such attribute called custom list controller but in the controller page if we
display multiple records then that page we can call it as custom list controller.
In controller class, we have to query the records from the database to display the records
on the page.
controller=MainClass
extensions=ClassA,ClassB,ClassC
To store the following kind of files and refer on the visualforce page
images
javaScript/jQuery
zip files
<apex:pagemessages>
</apex:pagemessages>
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.Error,Error
Message));
Note: For the standardController no need to include code inside of the Apex Class.
Following severity levels are available
1. CONFIRM
2. ERROR
3. FATAL
4. INFO
5. WARNING
Click here for the reference
9. What is RecordSetVar?
on a standardController page to display the multiple records we use recordSetVar (without the
support of any extensions class).
inputText:Always display the field as text box irrespective of data types (Checkbox,
Picklsit, Look up).
outputText:Always display the field value as text irrespective of data types (Currency,
Look up, URL etc.).
15. What is pagination and what are the ways to achieve it?
Assume that we need to display 100 records on the page. If the requirement is to display only 10
records at a time
We can achieve the above functionality with Pagination. We can achieve the pagination in two
ways
1. Using standardSetController
2. Using Limit and Offset keywords in SOQL
3. What is Wrapper Class?
Wrapper Class is nothing but list of instances of a certain class. Follow the below steps to create
the wrapper list
1. Create an Apex Class say MyWrapper'(It can be inside/outside of the controller class.)
2. Declare the necessary variables in the class to store the information.
3. Create a list called MyWrapList for MyWrapper.
4. Create multiple instances for MyWrapper and store it in MyWrapList list.
Visualforce Pages
Assume that you are referring aRecord Type Name multiple times in an apex class, in
future if the client asked to rename the record type then in all the palaces we need change
by searching which consume good amount of time. To avoid that if you store theRecord
Type Name in custom label and refer that custom label in all the places. If you need to
change the name in future then you need to change only in that custom label.
Assume that you are displaying an error message on the visualforce page, in future if the
client asked to change the error message then it will be a code change. For code change it
requires lot of approvals from business which consume lot of time. If you keep the error
message in a custom label and refer on the page, in future it wont be a code change, in
production directly they can replace the error message in that custom label.
We can create.
20. What is the difference between rendered, rerender, renderAs and contentType?
rendered: Accepts true or false. If it is true then component will display on the page, if it is false
then it wont display on the page.
rerender: To refresh certain area of a page based on component id.
renderAs: Used in page tag, We can display VF page in PDF format if we give renderAs =
PDF.
contentType: Used in page tag, we can download VF page in MS Word/Excel etc. based on the
input to contentType.
21. What is button overriding?
We can override few standard buttons with visualforce pages.
To override standard button with visualforce page, VF page should be of standardController to an
object which is related to standard button.
Custom buttons we can override with URL, javaScript or Visualforce.
22. What are the inline visualforce pages?
On a record detail page we can embed visualforce pages.
Assume that you are displaying inline VF page on Account record detail page. VF page should
be standardCotnroller to Account Object.
Note: We cannot embed VF page inside of the Edit page.
23. What is the use of immediate attribute?
Whenever we click on Back or Cancel button on a VF page if there are mandatory fields then
we will see the error messages saying to populate those field values.
To bypass validations upon clicking on a button/link, we can use immediate attribute.
25. What is retURL and saveURL?
We cannot override Save button. When you are on record edit page upon clicking on Save
button if you want to navigate it to a specific url then we need to
append saveURL=someURL parameter to the URL. You will come to this edit page if you click
on New or Edit button which can be overriden with VF page, from this page you can pass
saveURL parameter to edit page.
When you are on record edit page upon clicking on Cancel button if you want to navigate it to a
specific url then we need to append retURL=someURLparameter to the URL.
26. What are the Visualforce Components?
Like VF page we can create visualforce component. Syntax
?
1
<apex:component>
</apex:component>
We can use only controller and extensions attribute for the VF component. standardController
cannot be used.
When to use VF Component?
1. If you want to reuse the VF page logic.
2. If the VF page logic is huge and if you want to split into different pieces.
3. What is the order of execution of VF page?
We can request VF page in two ways
1. Get Request:Whenever we click on a link or button or directly hitting the url in address
bar we can open a VF page.Get Request Order
2. Postback Request:On a VF page after populating fields if you click on save button certain
action will invoke it is nothing but post back request.Postback Request Order
28. What are the types of Ajax Functions in VF page and what is the usage?
Ajax Functions
Action support, action status, action function,
action poller:,
A timer that sends an AJAX request to the server according to a time interval that
you specify. Each request can result in a full or partial page update
action region:.
actionRegion provides an area of a Visualforce page that decides and separates
which components should be processed by the force.com server when an AJAX
request is generated. Only the components which are inside actionregion
component are processed by server, so it increases visualforce page
performance. Here components means, all visualforce tags like inputField,
outputField, outputPanels etc.
Pricebook
Product
PricebookEntry
Opportunity
Opportunity Product
First you setup a Pricebook. If you have different prices based on customer type or deal
then you would need to create custom Pricebooks (e.g. online tutoring, in-home tutoring,
and school tutoring).
Third you would need to associate Product with the Pricebook. If you have only a
standard Pricebook then you just need to associate it with the Product otherwise, you
would need to associate with the custom Pricebook too. But in order to associate custom
Pricebook you have to associate standard Pricebook with the Product first. This process
create a PricebookEntry record.
Fourth you would need to create an Opportunity (Note: There is a field PricebookId on
Opportunity that says this Opportunity has associated to whcih Pricebook?).
Fifth you would need to add Opportunity Products. First time when you add it will
prompt you to choose the Pricebook (e.g. standard or custom Pricebooks will be shown in
the picklist).
After that all the Products will be shown which are associated with the Pricebook which
user has chosen already. After creating Opportunity Products, PricebookId field will be
populated on Opportunity. Now going forward user will only add those Products which
are associated with that Pricebook (Note: Opportunity can have only one PriceBook
associated with it).
If in future user want to associate Opportunity with different Pricebook they need to click
on the button "Choose Pricebook" (Note: it will delete all the previous Opportunity
Product records.).
Note: You can not add 2 Products with different Pricebooks on the same Opportunity.
Scenario with Multi-Currency enabled:
Let's assume that your organization work on 2 currencies "USD" and "EUR".
Second you would need to setup Products (Currency ISO on Product will not do anything
so, you can remove from the page layout).
Fourth you would need to create an Opportunity and select a Currency ISO field "USD"
or "EUR" (Note: This will tell you that you will only Products which have been setup in
that Currency ISO code).
Note: All currency amounts are displayed in the default currency of the record as well as in the
personal currency of the user. When you change the default currency of a record, currency
amounts are not converted; they simply display with the new currency code.
What is Wrapper class?
A Wrapper class is a class whose instances are collection of other objects.
It is used to display different objects on a Visual Force page in same table.
@Future:
Use the future annotation to identify methods that are executed asynchronously. When you
specify future, the method executes when Salesforce has available resources.
For example, you can use the future annotation when making an asynchronous Web service
callout to an external service. Without the annotation, the Web service callout is made from the
same thread that is executing the Apex code, and no additional processing can occur until the
callout is complete (synchronous processing).
Methods with the future annotation must be static methods, and can only return a void type.
OWD:
Defines the base line setting for the organization.
Defines the level of access to the user can see the other users record
OWD can be Private, Public Read Only, Public Read and Write.
Setup -> Security Controls -> sharing settings -> Click on Edit
Manual Sharing:
Manual Sharing is sharing a single record to single user or group of users.
We can see this button detail page of the record and this is visible only when OWD setting is
private.
Criteria Based Sharing rules:
If we want to share records based on condition like share records to group of users
Whose criteria are country is India.
Setup -> security controls -> sharing settings -> select the object and provide name and
Conditions and save
Apex sharing:
Share object is available for every object(For Account object share object is AccountShare ). If
we want to share the records using apex we have to create a record to the share object.
What is OWD..?
What is Batch Apex and why to use batch Concept..?
what are the methods we have in Database.batchable() Interface..?
What is @isTest..?
What is test Class did you written any test classes..?
What are the best practices to write a test class..?
c)<apex:actionMethod>
D)<apex:actionRegion>
6. A user wabts to get the real-time data in the VF page without performing the action,
which VF tag will the User use to do the ajax call ?
A) Apex:actionstatus
B) Apex:actionpollar
C)Apex:actionsupport
D) Apex:actionregion
7. Which is the correct order of the execution ?
A) Controller constructor,pages action method invoked, getter method called
B) Getter method called, controler constructor,pages action method invoked
C) controler constructor,Getter method called ,pages action method invoked
D) pages action method invoked, controler constructor,Getter method called .
9.What is the governor limit for the SOQL quries oin a single transaction of a batch class ?
A) 100 quries
B) 200 quries
C) 50,000 quries
D) No Limit
10.@Future annotatio can be use in Triggers ?
A) true
B) False
11.An organisation has after undelete triggers for accounts and contacts.A user
accidentally deieted 1000 account records and undeletes them from the recycle bin.
A) when the accounts, were deleted,associated contacts were not deleted,hence when undeleted
the records ,only the account after undelete triggers fire
B) when the accounts are deleted,associated contacts were also deleted,when undelete
the records ,both the accounts and contacts were recovered after delete trigger fire.
C) when the accounts are deleted,associated contacts were also deleted,when undelete
the records ,both the accounts and contacts were recovered, and only the account
after undelete trigger fire.
D) when the accounts are deleted,associated contacts were also deleted,when undelete
the records ,only the accounts were recovered,so only the account after undelete trigger fire.
12. Can we delete a user record from SFDC ?
A) Yes
B) No
13.What is the limit of the view state in SFDC ?
A) 100 kb
B) 200 kb
C) 135 kb
D) 135 mb
14. An object ABC has a field named XYZ_C which is of data type picklist{Text}.The
picklist values for
field are p,Q , R ,S. write the code to retrieve all the picklist values thst are provided in this
field.
ANS:
15. A developer wants to move account data from Salesforce to a customer hosted
endpoint.this
includes any account creation,update, or deletion that occurs via the UI or API.The
developer would
also like to include related contact information with each account publish. which design can
accomplish this? choose 2 answers.
A)Outbound messaging
B) Asyncronous Apex involved by an account
C) Visualforce Controller for Account trigger
D) Customer hosted polling client
16. Will the code compile ?
@isTest
public class MyTest{
Public static testMethod void myTestMethod(){
System.assertEquals(6,2+3);
}
}
A) No, because the @isTest annotation cannot be used with public classes
B)No, because the assertion will evaluate false
C) No, because the testMethod keyword cannot be applied to public methods
D) yes,the code will compile
17.
C) Both
D) None
25. A profile is assigned to 3 users say Developer,Application has 3 tabs Account,Contact
and Oppurtunities.All these
tabs are currently hidden for the profile developer profile has Read access to Account and
Contact.User 1 and User 2
should be able to create Account and Contact and also view its tabs.How will u achieve
this ?select all that are applicable.
A) Sharing rules
B) New profile
C) Permission sets
D)Organisation wide default.
26. Visualforce page can have more than 1 Custom Controller.
A) true
B) False
27. What is the order of the execution to Visualforce page. if a Visualforce page has more
than one execution?
A) Left to right
B) Right to left
C) Not applicable
D) Extension will execute based on Ap[ex queue availability
28. A user inserts data on visualforce page that involves an Apex trigger, which calls on
sObject.addError()
method.which statement is true about the error message being displayed on the visual force
page ?
A) the error will be displayed,provided the <apex:pageMessage> component is included onthe
page
B) the error will be displayed next to the field that caused the error
C)the error message will not be displayed unless the field specific subject.field.addError()method
is used
D) the error message will not be displayed as Apex errors are recorded in the debug log
29. Which statement is true about the following triggers ?
Trigger setReviewDate on Lead(before insert,before update){
Trigger.new[0].Review_date_c=System.Today()+7;
}
A) A trigger exception is thrown if the trigger collection is greater than 1.
B) Review_Date_c only applied to the first item if the trigger collection size is greater than 1.
C) System.Today()+7 throws an error
D) there is no update DML statements so Review_Date_C is not committed to the database.
30. The executeAnonymous method calls an apex script that makes changes to the
database.
the script however,fails during execution.what happens to the database changes already
made by the
script?
A) Database changes are not allowd through anonymous blocks
B) changes that are already made are commited
C) Force.com automatically rolls back any changes made to the datbase.
D) The system administrator is notified to roll back the changes.
31.Which statement is FALSE about the usage of Apex describe ?
A) on the desribe result , the getSObjectField method returns the tokens for the field.
B)The DescribeSObjectResult contains all the decribe properties for the corresponding sObject
C)Describe results are serializable and validated at compile time.
D) Both sObjects tokens and fields tokens have the method get Describe.
32.Which component is bound to the custom controller property status Message ?
Public Boolean statusMessage{get;private set;}
A) <apex:inputCheckboxvalue={!statusMessage}/>
B) Only explict getter and setter methods can be used for value binding.
C) <apex:inputTextvalue={!statusMessage}/>
D)<apex:outputTextvalue={!statusMessage}/>
33.What can be the type of parameters attribute can take in Apex Component ?
A) Set
B) Map
C)SObject(Generic)
D) Apex class type
E) String
34.what does use of the with sharing keyword enforce ?
A) Only the record sharing and FLS for the running user
B) Only the record sharing and the CRUD permission for the running user.
C) The record sharing for the current user.
D) The record sharing,FLS and OWD for running user.
Comparable Interface:
To implement the Comparable Interface, you must declare global class with the implements
keyword as follow:
1
compareTo() method:
The compareTo() method must return following integer value
1. 0 if both object is equal
2. >0 if the instance object is greater than objToCompare
3. <0 if the instance object is smaller than objToCompare
1) You have a page with Standard Controller and one Extension class.In Extenstion class
you have a method name called save().Now when your invoking save() method from page
whether it will execute Standard Controller save() method or Extension class save()
method?
Ans : The Save() method from the Extenstion class will be executed.
2) In a trigger you have addError() method and below that statement you have a
System.debug() statement.If addError() method is executed in trigger in that case whether
System.debug() statement will be executed or not?
Ans : Yes,Even after addError() method got executed the execution will not be stopped at
that line and it will executes below the System.debug() statement also.
3) If in your organisation Person Account feature is enabled.Whenever your converting the
Lead how you will decide which Account(Business or Person) to be created?
Ans : Based on the company field value on Lead we will decide whether to create Business
Account or Person Account.If Company field value in Lead object is blank then we will
create Person account on it's conversion and If Company Field value on Lead object is not
blank we will create Business Account
4) How will say particular lead is a Business Lead or Person Lead?
Ans : Based on the company field value on Lead we will decide whether that Lead is
Business Lead or Person Lead.If Company Field value is blank then it will be treated as
Person Lead,If not it will be treated as Business Lead
5) Lets assume your having a object called Quotes and it is having 4 fields.Now I want to
add one extra field to each and every record in Quote object without creating it in Object
and I want to display list of Quote records on visual force page with 5 fields not with only 4
fields.
Ans : Whenever your working with these type of scenarios (i.e., Add extra field to each
and every record in object actually not creating that field in object) we have to use
Wrapper class concept which will add one or more fields for each and every record.
6) When you will end up with MIXED_DML_OPERATION error in Salesforce?
Ans: With in a single transaction if you are trying to perform dml operations on setup
objects and non-setup objects with same user(Logged in user) than it throws that error.To
avoid that error we need to perform DML on Set up objects with logged in user and on non
setup objects with some other user using System.runAs() and vice versa
7) What are the limitations/considerations for Time-Dependent Workflow?
You can not write time-dependent action on workflow rule Evaluation Criteria of
type Every time the record is created or updated.
Maximum you can write 10 time dependent triggers per one rule
8) While setting OWD (Organization wide sharing), can we change/modify the setting of
child record in case of Master-Detail relationship?
Ans: No, child record is controlled by parent settings.
9) In case of Master-Detail relationship, on Update of child record can we update the field
of Parent record using workflow rule?
Ans: Yes, the Master fields are also available for evaluation criteria.So, we can acheive this
with workflow.For more information please visit this post