Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 46

1.Scenario: I have a picklist field in the record with A,B,C values.

Whenever I update the

record, how can you compare old value and new value of picklist in trigger?

Ans: Trigger picktrig on Contact(before update)

Contact c1=trigger.newMap[0];

Contact c2=trigger.oldMap[0];

if(c1.id!=c2.id)

c1.picklistfieldname='text';

update c1;

2.what is the oldMap?

Ans:oldMap:It gives Id's to the Old versions of the Sobject Records.

3.have worked on annotations and what are they?

Ans: Yes,they are @isTest and @future.

@future: @future annotation to identify the methods that are executed asynchronously.

4.What is the use of @isTest annotation, is it used only for testing?

Ans: @isTest annotation used for writing the test classes.

5.If we don't write testclasses what will happen?

Ans: before deploy from sandbox to production if you want to validate the changeset in production we
need Test Classes.without test classes we can move the classes from

sandbox to production through changesets.but if you want to move the packages from one Org to
another Org we need test classes for classes.

suppose we have so many classes in one application one test class coverage is 50%,another one
60%,another one 90% totally avg code coverage above 75% in org.
we can do move classes from sandbox to production through changesets.

but if you want to move packages from one Org to another Org this is not possible every test class
coverage must be 75% then we can send the packages otherwise

we can't send packages.

6.How do you deploy using changesets and Eclipse?

Ans: through changesets

1.we need to authorize the deployment connection

2.we have to create and upload Outbound Changeset in Sandbox.

3.we have to validate the Inbound Changeset

4.Deploy an Inbound Changeset.

7.what are advantages or disadvantages of Changesets and Eclipse?

Ans: Advantages of Change sets:

1. The change set remains active in organization for a period of time allowing for an audit of changes
(beyond the setup audit trail). This functionality is in Sales force setup.

2. Change set can be include almost anything for example classes, pages, reports, objects, page
layouts, record types, email templates etc.

3. Easy to deploy sandbox to production.

Authorize deployment connection.

Create outbound change set in sandbox environment.

Upload from Sandbox environment.

Review inbound change and deploy in production.

4.Faster as compare to all other tool like Eclipse IDE.

Disadvantage of Change sets:

1. Lookup filter, labels, new picklist values, custom setting & labels are not available for
deployments.

2. Time based workflow trigger actions cannot be migrated.


3. When migrating workflows, you need to manually select the workflow rule and its actions
separately.

4. No option of refreshing the change sets tool.

5. Not all metadata is supported in the metadata API which means some manual changes may need
to be made in the production org.

Advantages of Force.com IDE:

1. It provides a comfortable environment for programmers familiar with integrated development


environments, allowing you to the code, compile, test, and package and deploy all from within the IDE
itself.

2. It Provide the code editor following are features:

Syntax highlighting for the Apex key words.

Code assist for Apex system classes, user-defined classes, and schema objects.

Click-to-line integration with errors and testing views.

Unlimited undo and redo.

Tabbed views of source code and XML metadata definition on app.

3. We can validate the selected classes/trigger etc before deployment.

4. Force.com IDE provides an Apex Test Runner view where you can test your methods to see which
the tests are are passing or failing helpful in Test class.

5. If deployment fail it will shows the errors with line number.

Disadvantages of Force.com IDE:

1.It takes long time for loading and deployments which is initialization step of our project.

2.We can’t run our visual force page GUI on browser.

3.Detailed logs are not generated in Integrated Development Environment. For example system log
file.

4.We are not able to update user profiles using eclipse IDE. Like configuration changes not done in
this tool.

8.Before deploy in production, is it required validating the changesets.

Ans: No it is not required.


9. what are approval processes?

Ans: Approval Processes are Automated business processes and complex business process.we can create
two types of approval processes they are

Jump start wizard - single step approval processes

Standard setup wizard - multi step approval processes

Approval Processes contains Intial submission Action,Approval Steps,final Approval action,final


rejection action,recall action

for every action we can send email alerts,we can assign tasks,we can do the field updates and we
send outbound messages.

10.What is CRM and its life cycle process?

Ans:Customer relationship Management(CRM) is as a process that will help bring together lots of pieces
of information about customers, sales, marketing, effectiveness, responsiveness and market trends.

CRM provides best relationship between client’s and company with this best relationship we can
acquires new client’s quickly.

Life Cycle Process: Every Org contains Products.for that products we use Campaigns.based upon
Campaigns Leads are coming.that leads might be opportunity or account or contact.

11.What are the owd?

Ans: OWD is default access for each object.OWD restrict the access.

12.In Master-detail Relatinship, parent object have private owd then can we give read/write access

to child object?

Ans:No, we can't give.

13. what is cloud computing?

Ans: Cloud Computing is actively usage of Hardware & Software & Infrastructure as a Service through
cloud. Cloud Computing is internet based computing

where virtual shared servers provide software, infrastructure, platform, devices and other resources
and hosting to customers on a pay-as –you-use basis.

Cloud Computing is to share the resources over the network. End users can access cloud based
applications through a web browser while business software and data stored on server.
14. what is CRM?

Ans: Customer relationship Management(CRM) is as a process that will help bring together lots of pieces
of information about customers, sales, marketing, effectiveness, responsiveness and market trends.

CRM provides best relationship between client’s and company with this best relationship we can
acquires new client’s quickly.

15. what is the difference b/w with and without sharing?

Ans: with sharing : 1. Enforces sharing rules that apply to the current user.

2. All the sharing rules in the organization effected.

with out sharing : 1.Ensures that all the sharing rules of the current user not enforced.

2. without having permission we can see the object records.

16. what is actionFunction?

Ans: action function: with the help of Javascript Function we can call the apex method in the apex class.

example: <apex:commandLink onclick="show()"/>

<apex:actionFunction name="show" action="{!showmethod}"/>

17. what are owd?

Ans: OWD's controls the Default access for each object.and it restrict the access.

OWD's Contains Private,public read only,public read/write,public read/write/transfer,public full


access,controlled by parent,grant access using Hierarchies.

18. what are tags in salesforce?(search tags)

Ans: 1. Personal Tags

2. Public Tags

19. how much do you rate yourself in apex,vf,admin?

Ans: apex-3.5 outof 5, vf-4 outof 5, admin-3.5 outof 5.

20. name some custom objects and fields you have used in your project.

Ans: Custom Object Names:

Field Names:
21. what is web to lead functionality?

Ans: Using web to lead you can capture contact and profile information from users in online and
automatically generate new leads in salesforce.com

22. list some user interface settings

Ans: 1. Enable Hover Details

2. Enable Related List Hover Links

3. Enable Inline Editing

4. Enable Collapsible Sections

5. show quick create

6. Enable Printable List Views

7. Enable Collapsible Sidebar

8. Enable Enhanced Pagelayout Editor

9. Enable Enhanced Profile List Views

23. what are governor limits?

Ans: 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.

24. when we use system.runAs()?

Ans: lets you write test methods that change user contexts to either an existing user or a new user. All of
that user's record sharing is then enforced.you can use only

runas in testMethod.the original system context is started again after all runas() test methods
complete.

25. how to provide login hours for users?

Ans : Through Profile.we assign this profile to user so that login hours will be applied to user.

26. have you worked on flows?

Ans: No, but i know how to use flows.using flows we develop the screens and navigating the screens.
27. how do you upload file using vf?

Ans: using <apex:inputFile> Tag.

28. what is appexchange?

Ans: appexchange is the Application Exchange market place here we can buy the applications and we
can sell the applications.

29. what is salesforce-to-salesforce?

Ans : using salesforce-to-salesforce we can transfer the records from one organization to another
organization.

30. what is polymorphism and encapsulation?

Ans : Polymorphism: Implementing single function with multiple functionalities.polymorphisms are 2


types

1.static polymorphism

2. Dynamic polymorphism

1.static polymorphism:static polymorphism achieved using Function overloading,Operator


overloading

2.Dynamic Polymorphism: Dynamic Polymorphism achieved using Function Overriding.

Encapsulation : Encapsulation is a mechanism of binding the data nothing but variable and code that
acts upon the data into a single unit.

31. have you worked on integration?

Ans: NO.

32. explain the scenario and how did you do that?(asked each step)

33. do you know about s-controls?

Ans:No.

34. what are the types of tabs?

Ans.Custom Object Tabs,Web Tabs,Visualforce Tabs.


35. what is chatter application?

Ans: Salesforce Chatter provides a rich suite of collaboration features to any application built on
Force.com.

With Salesforce Chatter, your users and data can provide a stream of live updates, enhancing how
applications, data and knowledge is used.

36. have you used jquery in your applications?

Ans: No.

37. what is a record type?

Ans: 1. using recordtype we assign the different pagelayouts to different users based on their profiles.

2. we enable the different sets of standard/custom picklist values to different users.

38. types of sandboxes?

Ans: 1.Developer-it is free sandbox

2.ConfigurationOnly Sandbox-having cost around 10% of production

3.Full copy Sandbox - having cost around 15%-20% of production.

39. can we perform dml operations in constructor?

Ans : No.

40. what is a junction object?

Ans : which Object has two master details relationships that is called junction object.

41. what is the difference b/w render,rerender and renderas?

Ans: render: to display or hide the components

rerender: it referesh the perticular block.

renderas: it converts the page to pdf/word/csv.

42. what are changesets?

Ans: changesets are Deployment Tool.it deploy the customizations from one environment to another
environment.changesets are inbound changeset,outbound changset

outbound changeset send the customization to inbound changeset.

inbound changeset received the customiztions from outbound changeset and deploy to production.
43. what is externalId?

Ans: externalId is a Manual RecordId.using this we can inteagrate to external systems.

externalId supports Text,Numer,Email Field Types.

we can only create 3 externalIds per Object.

44. what is the difference between externalId and uniqueID?

Ans: ExternalID : 1. we can create multiple records with same externalId.

2. It supports Text,Number,Email Field Types.

3. We can create 3 externalIds per object.

uniqueID : 1. we can't able to create multiple records with same uniqueId.

2. It supports Text,Number,Email Field Types.

3. we can create 3 uniqueIds per object.if you want create more by raising case to salesforce
then we can create.

45. what is your team size?

to whom do you report?

Ans: My Team Lead.

write trigger to select checkbox if region america is selected in picklist.

what is the toughest scenarion u have faced?

46. what is conditional highlighting?

Ans: Resolution

Conditional highlighting is an analytic enhancement.Highlight field values on summary or matrix


reports based on ranges and colors you specify.

To enable conditional highlighting, your report must contain at least one summary field or custom
summary formula.

This feature allows you to customize your reports by showing visual highlights for analysis.

This feature is accessible in the reporting wizard. To use this feature do the following:
1. Select the field that you want to analyze in your report.

2. Define the "Low Color".

3. Define lower threshold and "Mid Color".

4. Define upper threshold and "High Color".

5. View report.

This feature works for any quantified field (number, percent, etc.), and is also available in Dashboards.

Limitations/Considerations:

1. Only 3 conditions maximum per report.

2. Conditional Highlighting only applies to summary rows.

3. Available for numerical analysis only.

4. First condition is <; second condition <; third condition >=

47. How do I set conditional highlighting for a report?

Ans: Highlight field values on summary or matrix reports based on ranges and colors you specify. To
enable conditional highlighting, your report must contain at least one summary field or custom
summary formula.

To set conditional highlighting, click Show | Conditional Highlighting in report builder, then set the
breakpoint values and range colors to use.

48. what r the types of reports?

Ans: Tabular Report-it displays grand Totals in the report.it is like table report.

Summary Report- it groups the rows of data and display the subtotals.

Matrix Report-it groups the Rows of data and colums of data and display the subtotals.

Joined Reports- it combines the 2 or more reports.

49. what are webservice callouts?

Ans: using webservice callouts making request to external system from salesforce.com.

webservice callouts are Http callout,Restfull Api callout,Bulk api callout.


50. what is code coverage?

Ans: code coverage refers how much of your production code is covered by your test code.

51. How to assign Dashboards to User?

Ans: Using HomePage Layout.

52. Who are the Dashboard Running User?

Ans: 1.Run as Specified User.

2.Run as Logged-in User.

--- Users with “View My Team's Dashboards” can view the dashboard as any user below them in the
role hierarchy.

--- Users with “View All Data” can view the dashboard as any user in their organization.

Dashboard width settings:

Narrow,Medium,wide.

and general questions like

notice period, current ctc, expected, r u permanent or contract employee etc.

53.What is the salesforce architecture?

Ans: Salesforce architecture is the multitenancy architecture.Multitenancy refers to a standard in


software architecture where a single instance of the software runs on a server, serving multiple
client organizations (tenants).

54. Howmany types of controllers?

Ans: 3 Types Controllers are available in Salesforce.

1. What are the types of controllers?

Ans: 1.Standard Controller 2. Custom Controller 3.Controller Extension

55. Write trigger scenario?

Ans: Trigger Triggername on ObjectName(Events)

// Statements;

}
56. Howmany ways we can import data into salesforce?

Ans: we can import the data into Salesforce using import wizard, Apex Data Loader.

57. What is the default modifier?

Ans: when you declare the variables which modifier come automatically that is default modifier. The
default modifier is Private.

58. What are the services we are using?exaplain?


59. Why we are using batchapex?how to overcome the limitations in salesforce?

Ans: if you want to insert more than 50,000 records and to overcome the limitations in salesforce we are
using Batch Apex. Suppose using Database.getQueryLocator we can return 10,000 record ifwe are using
this in batch apex we can return 5 million records.

60. What about scheduleapex?

Ans: using schedule apex we can schedule the apex class.

61. Write a trigger , xyz is a record in that record how to store the address to the xyz record?
62. How to download the file from salesforce?

Ans: we download the file from salesforce using URL.

63. What is web-to-lead?

Ans: web-to-lead captures profile and contact information from users in website.

64. What is the difference between action and action support?

Ans: using action we can call an apex method in apex class.

Using action support we can give the support to another component using this component we
can call an apex method.

65. Howmany ways we can create required fields?

Ans: 1. Validation Rules 2.Page Layouts 3. Field Level Security 4. Triggers

66. Write apex class scenario?

Ans: public with sharing/without sharing classclassname

Declaring Variables, Get, Set Properties;

Declaring Methods; }
L&T

1. what is the CRM? Why salesforcecrm is the best?

Ans: Customer Relationship Management is as the process that will help bring together lots of
pieces of information about sales, marketing, customers, responsiveness, effectiveness and market
trends.it provides best relationship between clients and company with this best relationship we can
acquire new clients quickly.Salesforce CRM is working in Cloud and it is very

2. What is the difference between profiles and roles?

Ans: profile controls the accessibility of data. Role controls the visibility of data.

Profile controls apps,tabs,page layouts, Role Controls the records.

Record types,standard object permissions,

general user permissions, administrative permissions.

3. What is the workflow process?

Ans: Workflow process is the automated business process. using workflows we can assign tasks, we
can send emails, we can do the filed updates and we can send outbound messages.

4. What is the validation rule?

Ans: Validation rules used for the validations.validation rule consists of error condition, error
message, error location.

5. Write a validation rule of in the picklist A,B,C,D and other is there whenever we select other
need to show inputtext field?
What is transient?

Use the transient keyword to declare instance variables that can't be saved, and shouldn't be
transmitted as part of the view state for a Visualforce page. For example:

Transient Integer currentTotal;

You can also use the transient keyword in Apex classes that are serializable, namely in controllers,
controller extensions, or classes that implement the Batchable or Schedulable interface. In addition, you
can use transient in classes that define the types of fields declared in the serializable classes.

Declaring variables as transient reduces view state size. A common use case for the transient keyword is
a field on a Visualforce page that is needed only for the duration of a page request, but should not be
part of the page's view state and would use too many system resources to be recomputed many times
during a request.

Some Apex objects are automatically considered transient, that is, their value does not get saved as part
of the page's view state. These objects include the following:

What is call out and what is call in?

A) Making requests to external system from salesforce is callout.

Getting requests from external system is call in.

example of setting a custom timeout for HTTP callouts:

HttpRequest req = new HttpRequest();

req.setTimeout(2000); // timeout in milliseconds

How many ways we can schedule Batches?Is it possible to schedule with external tool like data
loader?

A) We can schedule batches using dataloader.

We can use Schedulable interface to schedule batches

Yes, We can schedule the data loader using CommandLine Interface.

Is there any limitations to use @future?

A) @future: future annotation to identify methods that are executed asynchronously.

Yes,the following are @future limitations.

1. No more than 10 method calls per Apex invocation

2. No more than 200 method calls per Salesforce license per 24 hours
3. The parameters specified must be primitive dataypes, arrays of primitive datatypes, or collections of
primitive datatypes.

4. Methods with the future annotation cannot take sObjects or objects as arguments.

5. Methods with the future annotation cannot be used in Visualforce controllers in either
getMethodName or setMethodName methods, nor in the constructor.

After executing workflow rules agin before triggers and after triggers will execute, How can you
avoid?

Are you using any external tools like bug traker in your company?

What is the difference between enterprise WSDL and partner WSDL?

A) Enterprise WSDL

* Is strongly typed, the object and its attributes are fixed.

* Contains the metadata about all standard and custom fields and objects.

* Can only be used against your Salesforce instance.

Partner WSDL

* Is loosely typed, the object and its attributes can be variable.

* Takes an array of key-value pairs.

* Does not contain metadata about objects and fields.

* Can be used against many Salesforce.com organizations.

What are the types of WSDL's?

A) 1.Enterprise WSDL

2.Partner WSDL

3.Apex WSDL

4.Metadata WSDL

for an email format data entering how can you write validation rules?

A) By using regex function


What is SFDC life cycle ( After getting the requirements what will be the steps)?

A) Analysis, Design, Develop the code in the sandboxes, writing unit tests, and moving to test sandboxes
to test

and then deploy to production with adequate code coverage.

* How can you avoid governer limits?

A) Using batches we can avoid governor limits.

* Have you used any annotations?

A) Yes.

* What is group by? When will you use?What is having? When will you use?beside Groupby is it
possible to use having?

A) While using aggregate functions we should use group by.

Group by is used in soql queries to fetch the records by grouping based on specific fields

Yes we can use having.

* What is the diffrence between List, set, map?

A) List:

List is a Unordered collection of values. It contains duplicate values. Each value is retrieved using the
List Index.

Set:

Set is an ordered collection of values. It does not contains duplicate values.

Map: Map is a key value pair datatype.duplcate value but not duplicate key.

* What is the difference between workflow and Triggers?

A) workflow Trigger

1. workflow is inbuilt functionality 1.Trigger is used for complex business process

used on single object. in which multiple objects can handle.

2. workflows fire when DML events like 2. Trigger is also same when DML events occur like

insert, update occur.workflows cannot fire insert, update, delete.in deletion trigger will fire.

when delete event occur.


3. workflows will only help to update the same object 3. Trigger can work across objects and where
in

or master object in custom master detail relationship. you can query the object as well as you can
do DMLs.

* How can you display error messages on visualforce page?

A) <apex:pagemessages/>

* Call by reference and call by value in APEX?

A) Object references are call by reference and primitive types are call by value.

* I need to put five radio buttons how can you do that?

A) Using <apex:selectRadio> tag.

* How can you show error messages on VF pages?

A) ApexPages.addMessage()

* Deployment Steps

A) . Create a Developer Sandbox

• Authorize a Deployment Connection

• Create and Upload an Outbound Change Set

• Validate an Inbound Change Set

• Deploy an Inbound Change Set


1. What is Transient key word?

Ans: To reduce the size of the view state in visual force, when we declare a variable as transient it
will not save in the view state.

2. What are the actions in workflows?

Ans: Task, Email, Field update, outbound messages, Select existing actions

3. How many ways can you access the controller methods in visualforce?

Ans: <apex:actionFunction>, <apex:actionSupport>, <apex:actionPoller>,


<apex:page>,<apex:commandLink>, <apex:commandButton>

4. Can you access the private variable in visualforce?

Ans: No.

5. What is overloading and overriding?

Ans: Overriding – Defines a method or property as overriding another defined as virtual in a class
being extended or implemented.
Overloading - same method name with different arguments, may or may not be same return type
written in the same class itself.

6. Can we override the methods in same class?

Ans: No. It throws an exception like Method already defined: m1()

7. Can you access the formula fields of accounts from contacts?

Ans: Yes

8. How can you change the public read only to private through the sharing rules?

Ans: No.

9. What is SOAP and REST api? And difference?

Ans: SOAP API: Use the SOAP based force.com web services API to create, retrieve, update or delete
records in force.com from any external system that supports SOAP based web services such as JAVA,
.NET or PHP client applications.

REST API: REST API Provides you with a powerful web services API that you can use to interact with
force.com and database.com.
10. If I have custom objects like A and B, I have 10 users on A and 10 users on B, A users can
access or see the data each other, but B userscannot access the each other data. How can you
do that through OWD?

Ans: Making owd as public read/write for A and private for B

11. How can avoid the security tokens for dataloader?

Ans: By adding the system address to Networkaccess.

12. Approval processes?

Ans: Approval Processes are complex business processes that require information gathering and
planning before implementing it.

13. If I have 1000 records inserting the on account how much time trigger fires?

Ans: 5 times based on batchload size the maximum size is 200.

14. How many ways of actions in work flow rule?

Ans: 5 ways

i. Task
ii. Email
iii. Field update
iv. Outbound message.
v. Select existing action
15. What is trigger.new?

Ans: It returns the collection of newly inserted records.

16. What is trigger.old?

Ans: It returns the old values of the updated or deleted records.

17. If I insert records on account can I access the trigger.old?

Ans: No

18. What is public, private, protected, and global?

Ans:Public : Defines a method or variable that can be used by any apex in this application or
namespace.

Private: Defines a class, method, or variable that is only known locally, with in the section of code in
which it is defined. this is the default scope for all methods and variables.
Protected: Defines a method or variable that is visible to any inner classes in the defining apex class.

global: Defines a class, method or variable that can be used by any apex that has access to the class,
not just the apex in the same application.

19. Difference between with sharing and without sharing?

Ans: with sharing : 1. Enforces sharing rules that apply to the current user.

2. All the Sharing rules in the organization effected.

Without sharing: 1. Ensures that the sharing rules of the current user are not enforced.

2.without having permission we can see the object records.

20. How much rate yourself in apex?


21. Why can’t you rate 10 for you?
22. How can your work in daily work ?

1.why we should not use future annotation function in batch apex

Ans: batch apex runs in asynchronus mode, future annotation runs in asynchronuous mode, so it is not
possible to write future annotatioon in batch apex

2. is it possible to write sosl queries in triggers


Ans: no, it is not possible becuase in tirggers we wont search, we queired the things

3. is it best practise to write seeAllData = true in test classes


Ans: no it is not best practice, becuase in db there are more organisations data's there is conflict occurs

4. then when we use this data?


Ans: some times the data may come from custom settings like that then we go for this one

5. difference b/w @remotaction and actionFunction


Ans: by using @remoteAction we can do send the form from client side to server side, but by using
actionFunction we can do client side validation
1. How many number of people are ther in your team what is their designation?

2. What is the length of record Id, Is it case sensitive?

A: 15 digit case-sensitive version which is referenced in the UI

18 digit case-insensitive version which is referenced through the API

The last 3 digits of the 18 digit ID are a checksum of the capitalizations of the first 15 characters.

The API will accept the 15 digit ID as input but will always return the 18 digit ID.

3. How can you test your application?

A: @isTest

4. How can you test unit testing in your organization?

A: @isTest(SeeAllData=true)

5. How can you test visualforce pages?

6. Who will provide work to you, is it your team lead?

A: Team Leader.

7. What is your interaction with your manager?

8. Why are you looking for change?

A: Permanent Employee POsition and Professional Growthing.

9. What is external id?

A: It is a Manual Recordid we can integrate to external systems.

External Id available for Text, Number and Email field types.

10. what is data loader?

A: The Data Loader is an easy to use graphical tool that helps you to get your data into Salesforce
objects.

The Data Loader can also be used to extract data from database objects.

You can even use the Data Loader to perform bulk deletions by exporting the ID fields for the data.
11. What are the events in trigger?(like before insert , after update)

A: Before Insert,Before Update,Before Delete,After Insert,After Update,After Delete,After UnDelete.

12. What is trigger.new?

A: It Returns Collection Of Newly Inserted Records.

13. How can you provide security for the records?

A: By using owd, rolehierarchy and sharing rules together

14.What are the Context Variables in trigger?

A: isBefore,isAfter,isInsert,isUpdate,isDelete,isUnDelete,isExecuting,New,Old,NewMap.OldMap,Size,

1.Difference between Lookup/Vs Master Detail?

Master – Detail Relationship :

If we delete master records then detail (Child) records are deleted.

It creates the parent(master) child(Detail) relationship between objects.

Child records do not have Owner fields it takes parents records owner as child records owner.

We can have maximum 2 master details on an object

Look up relationship :

Look up relationship creates relations between two objects.

If we delete any object then other object is not deleted.

We can have maximum 25 lookup on an object.

2.How to create a M:M relationship

You can use master-detail relationships to model many-to-many relationships between any two objects.
A many-to-many relationship allows each record of one object to be linked to multiple records from
another object and vice versa. For example, you may have a custom object called “Bug” that relates to
the standard case object such that a bug could be related to multiple cases and a case could also be
related to multiple bugs. When modeling a many-to-many relationship, you use a junction object to
connect the two objects you want to relate to each other.

Junction Object
A custom object with two master-detail relationships. Using a custom junction object, you can model a
“many-to-many” relationship between two objects. For example, you may have a custom object called
“Bug” that relates to the standard case object such that a bug could be related to multiple cases and a
case could also be related to multiple bugs.

Creating the many-to-many relationship consists of:

Creating the junction object.

Creating the two master-detail relationships.

Customizing the related lists on the page layouts of the two master objects.

Customizing reports to maximize the effectiveness of the many-to-many relationship.

3. Difference between profiles and permission sets

The key difference between the two is that the Profile is the users base set of permissions and all users
are assigned to one. A Permission set is just a way to give a user or a set of users extended permissions
without granting them to the entire group of users with a certain Profile.

I will explain this in one scenario, let me say that

You have one profile assigned to 20 different users.

Now Suppose you want give some extra permission to one of user. You have two options here.

a) To change Profile permissions : By this way those extra permissions will received by every user who is
having that profile

b) Second way is to create a permission set having those extra permission. You need to assign this
permission set to particular user by navigating to User detail page. In this way, you dont have to worry
about other users, as only specific user is getting those extra permissions.

You can assign permission set as many users you want.

The difference between Profile and Permission Sets is Profiles are used to restrict from something where
Permission Set allows user to get extra permissions.

4. What are record types and when would you use them

Represents the metadata associated with a record type. Record types allow you to offer different
business processes, picklist values, and page layouts to different users

Let me explain this in one scenario called,

Think there is one company which can manages both software aswell as hardware, for s/w customers I
want to provide one page and for H/w customers I want to provide another page in which some of the
fields are common for both the pages, so I will go for record type concept. I will create one object in that
I will create some fields, after that I will create two pages layouts, one is for s/w and another is for h/w
and I will integrate these two pages to record type.

5.govenor Limits

In my project periodically I will encounter a problems with governor limits, in most of the times I will
encounter a problem with dml operation, In my experience one thing I can say surely that it is always
recomended to skip dml operations in loops, take one list or set or map as per requirment collect all the
data into these collection objects and then atlast update that list or set or map which you choosen so
that u can bypass from governor limits.

Total number of SOQL queries issued 100(synchronose)


200(asynchronous)

Total number of records retrieved by SOQL queries 50,000

Total number of records retrieved by Database.getQueryLocator10,000

Total number of SOSL queries issued 20

Total number of records retrieved by a single SOSL query 2,000

Total number of DML statements issued2 150

6. In one sceanario there is possiblity to complete the task either in coding or throug salesforce
configuaration then which procedure you approach and why?

In this scenario I will go for salesforce configuration because it is always recomended that if it possible to
achive through salesfroce configuration then go through in this way if not then go for coding, becuase
configuration maintaince is easy when compared to coding.

7. In one scenario think that there are two objects A and B, these two objects is in master detail
relationship here is A is master and B is child and In B object record I given A object reference now I
will change the A object record value is it possible or not?

in master detail relation ship one thing you have to keep in mind that we are giving reference it means
we are providing Id values to child object as a reference but not values with these point we can say that
it is possible and the value of b object record is automatically will update.
1. In a trigger there are 1000 records how can you execute 200 records for each batch?

A) The for loop itself handles 200 records for each batch.

2. While importing data using data loader validation rules should be bypassed and for normal users
validation rules should be enforced how can you do that?

3. what are the limitations for triggers?How many mails we can send by using triggers at a time?

4. Is it possible to edit data in production?

A) we can edit the data but we cant edit apex code or visualforce code etc........

5. while importing data from data loader 5 records are imported after a long period of time another
10 records going to import whether trigger execute or not?

A) Yes.

6. Is it possibe to move particular field from production to sandbox?

A) Yes,we can move the particular field from production to sandbox.

7. Is it possible to move data from production to sandbox?

A) For fullcopy sandbox

8. What is dynamic apex?

A) dynamic apex: using dynamic apex we can gather what are the objects are available in salesforce.

And

using dynamic apex without using standard controller we can display the standard fields on visualforce
page.

9. Is it possible to execute batchable apex using trigger?

A: Yes.

10. Which type of triggers have you worked?

A: Before trigger and After trigger.

11. Have you integrated any application to the salesforce?

12. Is it possible to schedule using data loader?

A: yes.using CommandLineInterface.
13. Are you using any bug tracking tool in your organization?

A: NO.

14. How can you maintain your requirements in your organization, are you using any tool?

15. How many employees are there in your oraganization for sfdc?

16. What wil you do in Force.com IDE?

A) Code, complie, test and deploy

17. What are the new features of salesforce.com?

A: latest version Winter 13.


1. How many controllers are there in VF?

A) 3 controllers.

1.Standard Controller 2.Custom Controller 3.Extensions

custom controller: A custom controller is an Apex class that implements all of the logic for a page
without leveraging a standard controller.

controller extension: A controller extension is an Apex class that extends the functionality of a standard
or custom controller.

2. Is it possible to use multiple controllers in single VF page?

A) No.

3. Is it possible to use multiple Extensions in single VF page?

A) Yes.

4. What is the difference between Profile and Role?

A) Profiles Roles

----------------------------- ------------------------

Profile controls the accessability of data. Role controls the visibility of data.

profile controls the objects,apps,tabs etc. Role controls the Records.

5. How can you give permission to access specific record?

A) through Sharing Rules.

6. How to stop recursive Trigger?

A) Recursive Trigger: Recursive Triggers occur when one calls another trigger and that trigger in return
calls this trigger again and so on the loops continues

until we hit Governor Limit. The best way to stop this is using a static boolean variable.

7. In a VF page there is one multipicklist, if we choose one value, corresponding section of fields
should dispaly?

(Showing different fields based on multi-select picklist values)


8. What is actionregion?

A) ActionRegion: Defines an area in a page that defines which components should be processed when
AJAX request generates.

9. what is rerender,rendered and renderas?

A) rerender: To refresh a perticular block.

rendered: To display a perticular component.

renderas: To convert a page to PDF/word/csv.

10. What is wizard?

11. In one VF page there are some fields and in another page there are some other fileds and at final
page it should save, how can you do that?

12. Is it possible to pass parameters from one page to another page? A) Yes.

13. what is static variable?

A) If you Declare a variable or method as static we can call these directly using class name.

14. How can you make some fields not visible on a page apart from page layout, fields should be
visible to some users only irrespective of profiles?

(Can we hide fields/sections in an object based on the user?)

A) Permission Sets.

15. What is @future annotation?

A) @future: Identifies the methods that are executed asynchronously.

16. How many profiles can we assign to a user? A) One Profile.

17. Is it possible to write a test class inside a controller? A.) yes

18. Is it possible to assign multiple profiles for a single person? A) No.

19. Difference between Permissions and access settings for profiles and permission sets?

A) profiles controls the apps,tabs,record types,page layouts,object permissions,field permissions,user


permissions,apex class access,visualforce page access,

Login hours,Login IP Ranges.permission sets controls the apps, tabs,object permissions,field


permissions,user permissions,apex class access,visualforce page access.
INFOSYS

1.what are the recordtypes?

Ans: Using recordtypes we can assign different pagelayouts different users based on their profiles. and

To enable different sets standard/custom picklist values to different users.

2.why we are using dataloader?

Ans: through import wizard we can import upto 50,000 records if we want to insert more than 50,000
records then we use dataloader.through dataloader we can import

upto 1 million records.using import wizard we do only insert,upsert but using dataloader we do
insert,update,upsert,export,export all,delete.

3.why we are using batchapex?

Ans: if we want to insert,update,delete more than 50,000 records then we use batch apex.and to
overcome the governor limits we use batch apex.

4.write a code on trigger how to stop recursively updated record?

Ans: we will be taking a class and declare and initialize static boolean varible.based on this we stop the
recursively updated record.

5.webservices , customportal,patner portal?

Ans: webservices define static method that is exposed as a webservice method that can be called by
external client applications.

webservice methods can only be defined in a global class.

Customer Portal: Customer Portal to maintain the customer details.it is comes under into Service
Cloud.In customer portal by default cases,solutions standard objects displayed.

Customer Portal Cost is 2$/user/month.

Partner Portal: what are the objects,permissions available in owner all most those are availble in
Partner Portal.by default in partner portal Leads are displayed.

it comes under into Sales Cloud.Partner Portal Cost is 25$/user/month.

6.what is the use of remoteaction?

Ans: remoteaction is annotation.using this the javascript code can call an apex controller method from
visualforce page via javascript remoting.the method must be static and

either public or global.


KPIT

1.How to create reports & Dashboards?

Ans: using Report Builder we create the reports and using charts we create the dashboards.

2.what about trigger and trigger events?

3.what is workflow?

4.can we use trigger in workflow?

5.what are the methods in apex collections?

6.Howmany users are used your project?

7.Howmany types of sandboxes?and tell me order?

8.what are packages?

Ans: using packages we can send customizations from one org to another org.

9.what is the difference between managed and unmanaged packages?

Ans: managed packages unmanaged packages

1.it is not editable 1.it is editable

2.it is upgradable. 2.it is not upgradable.

10.what is the membervariable?

11.How to findout the duplicate records in the time of importing data into salesforce? how to detect
that duplicate records?

Ans: using import wizard we can findout duplicate records at the time of importing.

12.what is the present version of dataloader?

Ans: version 26.0


1. What is Apex ?
Ans: It is the in-house technology of salesforce.com which is similar to Java programming with object
oriented concepts and to write our own custom logic.
2.What is S-Control?
Ans: S-Controls are the predominant salesforce.com widgets which are completely based on Javascript.
These are hosted by salesforce but executed at client side. S-Controls are superseded by Visualforce
now.
3.What is a Visualforce Page ?
Ans: Visualforce is the new markup language from salesforce, by using which, We can render the
standard styles of salesforce. We can still use HTML here in Visualforce. Each visualforce tag always
begins with “apex” namespace. All the design part can be acomplished by using Visualforce Markup
Language and the business logic can be written in custom controllers associated with the Page.
4. Will Visual force still supports the merge fields usage like S-control ?
Ans: Yes. Just like S-Controls, Visualforce Pages support embedded merge fields, like the
{!$User.FirstName} used in the example.
5.Where to write Visualforce code ?
Ans: You can write the code basically in 3 ways.
1. setup->App Setup->Develop->Pages and create new Visulaforce page.
2. Setup -> My Personal Information -> Personal Information -> Edit check the checkbox
development mode. When you run the page like this,
https://ap1.salesforce.com/apex/MyTestPage. you will find the Page editor at the bottom of the
page. You can write you page as well as the controller class associated with it, there it self.
3. Using EclipseIDE you can create the Visulaforce page and write the code.
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.
7. How to create and host S Control in Salesforce ?

8. Difference between Sandbox and Development environment?

9. How to schedule export or take the backup of salesforce?

10. Do governor limits apply to sandbox instances?


Ans : Governor limits do apply to all Salesforce instances (trial, developer, production or sandbox
environments). However code coverage and successful execution of test classes is only enforced when
deploying to a production environment.
11. What is difference in ISNULL and ISBLANK?
ISNULL:
 Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this
function returns FALSE.
 Text fields are never null, so using this function with a text field always returns false. For
example, the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in the
New field. For text fields, use the ISBLANK function instead.
 Multi-select picklist fields are never null in s-controls, buttons, and email templates, so using this
function with a multi-select picklist field in those contexts always returns false.
 Empty date and date/time fields always return true when referenced in ISNULL functions.
 Choose Treat blank fields as blanks for your formula when referencing a number, percent, or
currency field in an ISNULL function. Choosing Treat blank fields as zeroes gives blank fields the
value of zero so none of them will be null.
 Merge fields can be handled as blanks, which can affect the results of components like s-
controls because they can call this function.
 When using a validation rule to ensure that a number field contains a specific value, use the
ISNULL function to include fields that do not contain any value. For example, to validate that a
custom field contains a value of ’1,’ use the following validation rule to display an error if the
field is blank or any other number: OR(ISNULL(field__c), field__c<>1)
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.
12. Is it possible to write the Apex code from user Interface?
You can add, edit, or delete Apex using the Salesforce.com user interface only in a Developer Edition
organization, a Salesforce.com Enterprise Edition trial organization, or sandboxorganization. In
a Salesforce.com production organization, you can only make changes to Apex by using the Metadata
API ,
deploycall, the Force.com IDE, or theForce.com Migration Tool. The Force.com IDE and Force.com
Migration Tool are free resources provided by salesforce.com to support its users and partners, but are
not considered part of our Services for purposes of the salesforce.com Master Subscription Agreement.
13. When you can’t add Time dependent action in Workflow rule?
You can’t add time-dependent actions to a rule if you choose Every time a record is created or edited.
14. What are the types of email templates available in salesforce.com?
1. Text
2. HTML with Letter Head
3. Custom HTML
4. Visual force
5. 15. What are the different Salesforce.com Editions and Limits?
Ans : check this URL
16. What is Roll up summary field in Salesforce?
Roll up summary field in salesforce calculates the Count, Sum, Min or Maxof particular field of any child
record. Thus, we can say that Roll up summary field can only be created on Master object.
17. What will happen if the Account is deleted?
If the Account is deleted then Contact, Opportunity will also be deleted from Salesforce which are
related to that Account.
From the database perspective, check below image of child relationships of Account:

Account Child relationship in salesforce


If we use schema builder, released in Winter 12 it would look like:
Account Contact and Opportunity of salesforce in schema builder

18. How many types of the relationship fields available in Salesforce>


Ans :
1. Master Detail
2. Many to Many
3. Lookup
4. Hierarchical
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.
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 executionwithin 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?
Ans :
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 before triggers.
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. How to restrict any Trigger to fire only once ?
Ans:
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.
1 public class HelperClass {
2 public static boolean firstRun = true;
3}
4 trigger affectedTrigger on Account (before delete, after delete, after undelete) {
5 if(Trigger.isBefore){
6 if(Trigger.isDelete){
7 if(HelperClass.firstRun){
8 Trigger.old[0].addError('Before Account Delete Error');
9 HelperClass.firstRun=false;
10 }
11 }
12 }
13 }
27. What is difference between WhoId and WhatId in the Data Model of Task ?
Ans :
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
Check Data Model of task here

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”.
Read this article, to get detailed idea on this topic.

29. How you can provide the User Login (Authentication) in Public sites created by Salesforce.
Answer : We can provide the authentication on public sites using “Customer Portal”.
This part of the interview question mainly focus on the dynamic Apex feature of the salesforce.com .
30 : What is the dynamic Apex?
Ans : Dynamic Apex enables developers to create more flexible applications by providing them with the
ability to “Access sObject and field describe information”, “Write Dynamic SOQL Queries”, “Write
Dynamic SOSL Queries” and “Dynamic DML”.
31 : How to get the list of all available sobject in salesforce database using Apex (Dynamic Apex)?
Ans:

1 Map m = Schema.getGlobalDescribe();
32 : How to create instance of sobject dynamically? Normally the sobject is created like “Account a =
new Account();”. But if you are in situation that you don’t know which sobject is going to be
instantiated ? Means it will be decided at runtime, how you will handle it? Hint : Use Dynamic Apex.
Ans:
1 public SObject getNewSobject(String t)
2{
3
4 // Call global describe to get the map of string to token.
5 Map gd = Schema.getGlobalDescribe();
6
7 // Get the token for the sobject based on the type.
8 Schema.SObjectType st = gd.get(t);
9
10 // Instantiate the sobject from the token.
11 Sobject s = st.newSobject();
12
13 return s;
14 }

33 : How to get all the fields of sObject using dynamic Apex?


Ans:
1 Map m = Schema.getGlobalDescribe() ;
2 Schema.SObjectType s = m.get('API_Name_Of_SObject') ;
3 Schema.DescribeSObjectResult r = s.getDescribe() ;
4 Map fields = r.fields.getMap() ;

34 : How to get all the required fields of sObject dynamically?


Ans:
There is no direct property available in Apex dynamic API to represent the required field. However there
is another way to know about it.
If any field have below three properties then it is mandatory field.
1. If it is Creatable
2. If it is not nillable and
3. If it does not have any default value
1 Map m = Schema.getGlobalDescribe() ;
2 Schema.SObjectType s = m.get(so.apiName) ;
3 Schema.DescribeSObjectResult r = s.getDescribe() ;
4 Map fields = r.fields.getMap() ;
5
6 for(String f : fields.keyset())
7{
8 Schema.DescribeFieldResult desribeResult = fields.get(f).getDescribe();
if( desribeResult.isCreateable() && !desribeResult.isNillable() &&
9
!desribeResult.isDefaultedOnCreate() )
10 {
11 //This is mandatory / required field
12 }
13 }
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
1
missing. '));
in Visualforce page add below tag where you want to display the error message.
<apex:pageMessages ></apex:pageMessages>
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
of encapsulation in java we declare any variable as private and then creates the setters and getters for
that variable.
1 private String name;
2 public void setName(String n)
3{
4 name = n;
5}
6 public String getName()
7{
8 return name;
9}
However, the Apex introduced the new concept of property from language C# as shown below:
1 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”.
1 String recordType = Apexpages.currentPage().getParameters().get('RecordType');
use?
1.How many ways to call apex class
Ans:6

From another class , From Trigger ,From Visualforce page ,From Developer console
Form JavaScript button, Links ,From Home page components

2.How many ways to schedule apex


Ans:4
a) Via a VF controller (such as from a button click)
b) Via a trigger - although extreme care must be taken here as you can only have 25 scheduled jobs
active at one time
c) Via anonymous Apex executed in the Development Console
d) Via the Schedule APEX UI page in Setup
3. Static and Instance.

Static: Static methods, variables, or initialization code are associated with a class, and are only allowed
in outer classes. When you declare a method or variable as static, it's initialized only once when a class is
loaded. Static variables aren't transmitted as part of the view state for a Visual force page.
Instance: Instance methods, member variables, and initialization code are associated with a particular
object and have no definition modifier. When you declare instance methods, member variables, or
initialization code, an instance of that item is created with every object instantiated from the class.

4.What is instanceof, final, constants, variables.

Final: Final variables can only be assigned a value once, either when you declare a variable or in
initialization code. You must assign a value to it in one of these two places.

Methods and classes are final by default. You cannot use the final keyword in the declaration of a class
or method. This means they cannot be overridden. Use the virtual keyword if you need to override a
method or class.

Variable: Varaible value can be change any time. it cant be fix. Ex: Public Integer fstNumber;

Constants: Constant value can not be change. Constants can be defined using the final keyword, which
means that the variable can be assigned at most once, either in the declaration itself, or with a static
initializer method if the constant is defined in a class.
Ex: static final Integer fstNumber=10;
OR
static final Integer fstNumber;
static{
fstNumber=10;
}

5. What is the difference between Public, Private, Global, Abstract, Protected Access Modifiers.

Private: A variable that is only accessible from within the same APEX class or trigger where it was
created.
The variable is only visible locally. This setting is the default if no access modifier is specified.
You can have a class nested within a class. By default, these nested classes are private, meaning they are
only visible within the outer class.

Public : This means the method or variable can be used by any Apex in this application or Namespace.
Global: A variable that is accessible across Namespaces and Applications- a more common use is for
creating APEX
web services that can be consumed via JavaScript Remoting or external websites.

6. What is Custom Controller and Controller Extensions?

A custom controller is an Apex class that implements all of the logic for a page without leveraging a
standard controller. Use custom controllers when you want your Visualforce page to run entirely in
system mode, which does not enforce the permissions and field-level security of the current user.
A controller extension is an Apex class that extends the functionality of a standard or custom controller.
Use controller extensions when:

 You want to leverage the built-in functionality of a standard controller but override one or more
actions, such as edit, view, save, or delete.
 You want to add new actions.
 You want to build a Visual force page that respects user permissions. Although a controller
extension class executes in system mode, if a controller extension extends a standard controller,
the logic from the standard controller does not execute in system mode. Instead, it executes in
user mode, in which permissions, field-level security, and sharing rules of the current user apply.

7. What is visualf orce life cycle?

In the diagram above the user initially requests a page, either by entering a URL or clicking a link or
button. This initial page request is called the get request.
1. The constructor methods on the associated custom controller or controller extension classes are called,
instantiating the controller objects.
2. If the page contains any custom components, they are created and the constructor methods on any
associated custom controllers or controller extensions are executed. If attributes are set on the custom
component using expressions, the expressions are evaluated after the constructors are evaluated.
3. The page then executes any assignTo attributes on any custom components on the page. After the
assignTo methods are executed, expressions are evaluated, the action attribute on
the<apex:page> component is evaluated, and all other method calls, such as getting or setting a
property value, are made.
4. If the page contains an <apex:form> component, all of the information necessary to maintain the state
of the database between page requests is saved as an encrypted view state. The view state is updated
whenever the page is updated.
5. The resulting HTML is sent to the browser. If there are any client-side technologies on the page, such
as JavaScript, the browser executes them.
As the user interacts with the page, the page contacts the controller objects as required to execute
action, getter, and setter methods.

Once a new get request is made by the user, the view state and controller objects are deleted.

Note: If the user is redirected to a page that uses the same controller and the same or a proper
subset of controller extensions, a postback request is made. When a postback request is made, the
view state is maintained.

8.What are the Assignment Rules and Auto Response Rules?

Ans:

 Lead Assignment Rules—Specify how leads are assigned to users or queues as they are created
manually, captured from the web, or imported via the lead import wizards.
 Case Assignment Rules—Determine how cases are assigned to users or put into queues as they are
created manually, using Web-to-Case, Email-to-Case, On-Demand Email-to-Case, the Self-
Service portal, the Customer Portal, Outlook, or Lotus Notes.
 Auto Response Rules: An auto-response rule is a set of conditions for sending automatic email
responses to lead or case submissions based on the attributes of the submitted record.

Applicable leads include those captured through a Web-to-Lead form.


Applicable cases include those submitted through a:

 Self-Service portal
 Customer Portal
 Web-to-Case form
 Email-to-Case message
 On-Demand Email-to-Case message
9.What is System Mode and User Mode?

System Mode -: in which the object and field-level permissions of the current user are ignored.

User Mode :in which the permissions, field-level security, and sharing rules of the current user are
enforced.

10.What is view state?


 All non-transient data members in the associated controller (either standard or custom) and the
controller extensions.
 Objects that are reachable from a non-transient data member in a controller or controller extension.
 The component tree for that page that represents the page's component structure and the associated
state which are the values applied to those components.
 A small amount of data for Visualforce to do housekeeping.

View state data is encrypted and cannot be viewed with tools like Firebug. The view state inspector
described below lets you look at the contents of view state.
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.

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.

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.

How validation rules executed? is it page layout / Visualforce dependent?


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.

How many types of the relationship fields available in Salesforce?

1. Master Detail
2. Many to Many
3. Lookup
4. Hierarchical (It is available only on User Object, we cannot create this relationship)

What are the types of email templates available in salesforce.com?


1. Text
2. HTML with Letter Head
3. Custom HTML
4. Visual force

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.

If i want record level access then what should i use from Salesforce security model?
Ans: Manual Sharing
If i want Object level access then what should i use from Salesforce security model?
Ans: Profile

In OWD (Organization wide sharing), can i change the setting “Grant Access Using
Hierarchies” for Standard Objects ?
Ans: You cannot change it for Standard Objects However for Custom Objects its possible.

What is Mandatory while creating User, Role or Profile?


Ans : Its Profile.

In case of Master-Detail relationship, on Update of master record can we update the field
of child record using workflow rule?
Ans: No

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 “Criteria evaluation”.

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 the Parents setting.

What is the difference between Lookup Relationship and Master-Detail Relationship?

LOOK_UP RELATIONSHIP:
IN LOOKUP RELATIONSHIP WE CAN DELETE THE PARENT OBJECT IT WILL BE NOT AFFECTED TO THE
CHILD OBJECT.
IN LOOKUP RELATION WE CAN ESTABLISH A RELATION WITH THE 25 OBJECTS.

MASTER DETAIL RELATIONSHIP:


IN MASTER DETAIL RELATIONSHIP WHEN EVER WE DELETE THE PARENT OBJECT AUTOMATICALLY CHILD
OBJECT ALSO DELETED.
WE CAN ESTABLISH 2 MASTER DETAIL RELATIONSHIPS.

You might also like