Salesforce Interview Questions, Salesforce answers – Part 1
1. What is App in Sales force?
An app is a group of tabs that work as a unit to provide functionality. Users can switch between apps using the Force.com app drop-down menu at the top-right corner of every page.
You can customise existing apps to match the way you work, or build new apps by grouping standard and custom tabs.
Navigation to create app in Sales force: Setup ->Build ->Create->App-> Click on new and create your application according to your requirements.
2. What is object in Sales force?
Custom objects are database tables that allow you to store data specific to your organization in salesforce.com. You can use custom objects to extend salesforce.com functionality or to build new application functionality.
Once you have created a custom object, you can create a custom tab, custom related lists, reports, and dashboards for users to interact with the custom object data. You can also access custom object data through the Force.com API.
Navigation to create object in sales force: Setup->Build->Create->Object-> Click on new object and create object according to your requirement.
3. How many relationships included in SFDC & What are they?
We are having two types of relationships, they are
- Lookup Relationship
- Master-Detail Relationship
4. What is a “Lookup Relationship”?
This type of relationship links two objects together,
- Up to 25 allowed for object
- Parent is not a required field.
- No impact on a security and access.
- No impact on deletion.
- Can be multiple layers deep.
- Lookup field is not required.
5. What is “Master-Detail Relationship”?
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.
- Up to 2 allowed to object.
- Parent field on child is required.
- Access to parent determines access to children.
- Deleting parent automatically deletes child.
- A child of one master detail relationship cannot be the parent of another.
- Lookup field on page layout is required.
6. How can I create Many – to – Many relationship?
Lookup and Master detail relationships are one to many relationships. We can create many – to – Many relationship by using junction object. Junction object is a custom object with two master detail relationships.
7. A custom object contains some records, now my requirement is to create field in this object with master detail relationship. Can we create master detail relationship in this case?
No, directly we cannot create master details relationship if custom object contains existing records.
Following are the steps to create to create master-detail relationship when records are available in custom object.
- First create field with lookup relationship.
- And then associate look field with parent record for every record
- Next change the data type of the field from look up to Master detail.
8. List examples of custom field types?
Text, Pick list, Pick list (multi select), Date, Email, Date/Time, Date, Currency, Checkbox, Number, Percent, Phone, URL, Text Area, Geolocation, lookup relationship, master detail relationship etc…..
9. What is TAB in Salesforce?
Tab is a user interface component to user creates to display custom object data.
There are three type of tabs.
- Custom Tabs
- Visual force Tabs
- Web Tabs
10. Does user can create insert their own custom logo, while creating their own custom applications?
Yes user can upload their custom logo in documents and then they choose that logo for organization.
11. List things that can be customised on page layouts?
We can customise different things on page layout like, Fields, Buttons, Custom Links and Related Lists. We can also create sections.
12. What is a “Self Relationship”?
Self Relationship is a lookup relationship to the same object. Suppose let’s take an object “Merchandise”. Here we can create relationship in between the Account to Account (same object) object. That is called “Self Relationship”.
13. What are the main things need to consider in the “Master-Detail Relationship”?
Record level access is determined by the parent, Mandatory on child for reference of parent, cascade delete (if you delete the parent, it can cascade delete the child).
14. What is difference between trigger and workflow?
- Workflow
- Workflow is automated process that fired an action based on Evaluation criteria and rule criteria.
- We can access a workflow across the object.
- We cannot perform DML operation on workflow
- We cannot query from database
- Trigger
- Trigger is a piece of code that executes before or after a record is inserted or updated.
- We can access the trigger across the object and related to that objects
- We can use 20 DML operations in one trigger.
- We can use 20 SOQL’s from data base in one trigger.
15. 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.
16. What is Difference between SOQL and SOSL?
- SOQL(Salesforce Object Query Language).
- Using SOQL we can Search only on one object at a time.
- We can query on all fields of any datatype
- We can use SOQL in Triggers and classes.
- We can perform DML operation on query results.
- SOSL(Salesforce object Search Language).
- Using SOSL we can search on many objects at a time.
- We can query only on fields whose data type is text,phone and Email.
- We can use in classes but not in Triggers.
- We cannot perform DML operation on search result
17. What is difference insert() and database .insert() ?
Using insert method we can insert the records but if any error occurs in any record system will throw an error insertion fail and none of the records are inserted.
If we want to execute partially success of bulk insert operation we will use database .insert.
18. What is Static Resources?
Using Static Resources we can upload images, zip files, jar files, java script and CSS files that can be referred in a visual force page.
The maximum size of Static Resources for an organization is 250mB.
19. How to call java script using Static Resource in Visual Force page?
Add java script file in Static Resource setup -> develop -> Static Resources -> click on ‘New’ -> Name: filename and add file from local desktop and save.
We can use that file as follows in Visual Force page
- <apex: includescript values=” {! $Resource.fileName}”/>
20. What is sharing rule?
If we want to give the access to other users we use sharing rules.
21. How many ways we can share a record?
Role Hierarchy:
If we add a user to a role, the user is above in the role hierarchy will have read access.
Setup -> manage users -> roles -> setup roles -> click on ‘add role’ -> provide name and save.
OWD:
- Defines the base line setting for the organization.
- Defines the level of access to the user can see the other user’s 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.
22. What are the actions in workflow?
1. Email Alert
2. Task
3. Field Update
4. Outbound Message
23. How many ways we can made field is required?
1. While creation of field
2. Validation rules
3. Page Layout level
24. What is difference between Role and Profile?
Role is Record level access and it is not mandatory for all users.
Profile is object level and field level access and it is mandatory for all users.
25. What is the maximum size of the PDF generated on visualforce attribute renderAs?
15MB
26. How many controllers can be used in a visual force page?
Salesforce come under SAAS so, we can use one controller and as many extension controllers.
27. What is difference between Action support and Action function?
- Action function: Invoke the controller method from java script using AJAX and we can use action function from different places on visual force page.
- Action support: Invoke the controller method using AJAX when even occurs on page like onMouseOver, onClick, ect… and we can use action support for particular single apex component.
28. How many ways we can call the Apex class?
1. Visual force page
2. Web Service
3. Triggers
4. Email services
29. How to create Master Details relationship between existing records?
Directly we can’t create Master Detail relationship between existing records, first we have to create Lookup relationship and provide valid lookup fields and it shouldn’t null.
30. What is permission set?
Permission sets extend user’s functional access without changing user’s profile.
Ex: A user has only read access through profile on custom object, administrator want to give access Edit and create operations to him without changing the profile. Administrator creates the permission set having edit and creates operation on custom object and assign to that user.
Salesforce Interview Questions – Part 2
31. What are the different types of controllers?
We have three types of controllers. They are
- Standard controller.
- Custom controller.
- Controller extension.
Controller definition: A Visual force controller us a set of instructions that specify what happens when a user interacts with the components specified in associated Visualforce markup, such as when a user clicks a button or a link.
- Controllers also provide access to the data that should be displayed in a page, and can modify component behavior.
Standard Controller: A standard controller consists of the same functionality and logic that is used for a standard Salesforce page. For example, if we use the standard accounts controller, clicking a Save button in a Visualforce page result in the same behavior as clicking Save on a standard Account edit page.
Custom Controller: A custom controller is a class written in Apex that implements all of a page logic.
If we use custom controller, we can define new navigation elements or behaviors, but we must also reimplement any functionality that was already provided in a standard controller.
Controller Extensions: A controller extensions is a class written in Apex that adds to or overrides behavior in a standard or custom controller. Extensions allow us to leverage that functionality of another controller while adding our own custom logic.
32. What is Custom controller?
Custom Controller: A custom controller is a class written in Apex that implements all of a page logic.
- If we use custom controller, we can define new navigation elements or behaviors, but we must also reimplement any functionality that was already provided in a standard controller.
33. What is the difference between the Workflow and Approval Process?
Workflow rules and Approval Processes can be used together.
Workflow Rules | Approval Processes |
Are Triggered upon Save | Are triggered only when a user clicks “Submit for Approval” button. |
Consists of one set of criteria and actions | Consists of multiple steps |
Have an entry criteru8a, step criteria and step actions. | |
Have Initial submission action, rejection and approval actions and action for each step | |
Can be modified or deleted. | Some attributes can’t be modified processes must be deactivated before they can be deleted. |
Salesforce Interview Questions – Part 3.
34. What are the report Types?
Record types are used to display different picklist values and page layouts to different users based on their profiles.
35. How to make the Record type as default?
By using profiles.
Go to the particular profile and by using Record Type Settings we can make the Record types as default.
36. What is the Customer Portal and Partner Portal?
Customer portal: A Salesforce.com Customer Portal similar to a Self – Service Portal in that it provides an online support channel for your customers – allowing them to resolve their inquires without contacting a customer service representive.
37. Tell me one Governor Limit?
Total number of SOQL queries issued | 200 |
Total number of records retrieved by SOQL queries | 50000 |
Total number of records retrieved by SOQL queries | 20 |
Total number of records retrieved by a single SOSL query. | 200 |
Total number of DML statements issued | 150 |
38. What are the annotations in the Apex?
An Apex annotation modifies the way a method or class is used, similar to annotations in Java.
- @Deprecated.
- @Future.
- @Is Test.
- @ReadOnly.
- @RemoteAction.
39. What is @IsTest annotation?
Use the isTest annotation to define classes or individual methods that only contain code used for testing you application.
40. How many controller extensions we can use?
Any number of controller extensions.
41. What are the Collections?
- Lists.
- Maps.
- Sets.
42. What are the difference between the Sets and Maps?
- A Set is an unordered collection of primitives or sObjects that do not contain any duplicate elements.
- A Map is a collection of key-value pairs where each unique key maps to a single value. Keys can be primitive data type, while values can be a primitives, sObject, collection type or an Apex object.
43. What are the data types we can give for the Key and Values in Maps?
- Keys – Primitive Data Types.
- Values – Primitive, sObject, Collection Type or an Apex Object.
44. Have you Implemented record type in your project?
Yes, we have created Record Types and we have done Page Layout Assignment also.
Salesforce Interview Questions – Part 4
45. What are the types of Sandboxes you’re using?
Full Sandbox and Configuration only Sandbox.
- Full Sandbox : Full Sandbox is Production environment.
- Configuration Sandbox: Test Sandbox.
46. What is the difference between the with Sharing and with out Sharing keywords?
Use the with sharing keywords when declaring a class to enforce the sharing rules that apply to the current user.
Use the without sharing keywords when declaring a class to ensure that the sharing rules for the current user are not enforced.
47. What is the difference between Tigger.new and Trigger.old?
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.
48. What is the Custom Settings?
Custom Setting that provides a reusable set of static data that can be accessed across your organization. There are two types of custom settings.
- List Custom Settings.
- Hierarchy Custom Settings.
49. What is the difference between the Lookup and Master-detail relationship?
Lookup Relationships | Master-Detail Relationships |
We can create upto 25 lookup Relationships | We can create upto 2 Master-Details Relationships |
Lookup can be created if records already exists | Master-Details Relationships cannot be created if records already exists. |
If we deletes the Parent record, then the child will not be deleted. | If we delete the Parent record, then the Childs will be deleted automatically. |
Mandatory | Optional |
50. What is the difference between the Profiles and Roles?
Profiles: A collection of settings and permissions that define how a user accesses records. Profiles Control a user’s permissions to perform different functions in Salesforce.
- A Profile can have many users, but a user can have only one profiles.
Salesforce FAQ, SFDC Interview Questions – Part 5.
51. Can we create a user without assigning the profile?
No, because while creating the user, selection of profiles is mandatory thing.
52. How many ways we can make a filed required?
There are three ways to make a filed required. They are
- While creating a filed.
- Using Page Layout and using Validation Rules.
- FLS(doubt).
53. How many ways we can create visualforce page?
There are two ways to create a visualforce page. They are
- By using the URL.
- By using the path setup=> Develop=> Pages.
54. What are the assignment Rules?
Assignment Rules are used to automate organization’s lead generation and support processes.
- 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 wizard.
- Case Assignment Rules determine how cases are assigned to users or put into queues as they are created manually, using Web-to-Case.
55. What are the types of Relationships?
- Master- Detail.
- Lookup.
- Many to Many.
- Hierarchical.
56. Can we delete the user from Salesforce?
As per now, Salesforce does not allow to delete any user, how ever we can deactivate the user.
57. How to create the Many to Many relationships between object?
Create one custom object, which should have auto number as unique identification and create two Master- Detail relationships for this object. And this Object is called as Junction object.
58. What is Cross Object Formula?
Cross-Object Formula can reference merge fields from a master(“parent”) object if an object is on the detail side of a master-details relationship. We can reference fields from object that are up to ten relationships. We can able to insert related Object data into a formula.
59. How to hide a tab for an User?
By Profiles we can hide a tab from a user.
Use “Tab Hidden” setting for Tab Hide.
60. What is an External ID?
External ID are used when we interacting with a external systems. It will act as unique identifier. We can define 3 external ID fields per object. These are the data types of fields.
- Number.
- Text.
- Email.
Salesforce Answers, Salesforce Interview Question.
61. How to merge duplicates without going for third Party tools?
Click on the Tab and go to Tools section, we can find the Merge option.
62. How many ways we can do deployment?
There are three ways to do deployment.
- By using change Sets.
- By using Force.com IDE tool(Eclipse).
- By using Force.com Migration toolkit.
63. What is the best practice you are using while coding?
- Bulkify your code: Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time. When we try to load the link of the records using the Data Loaders, then we make sure that code will satisfy.
- Avoid SOQL Queries inside For loops: When queries are placed inside a for loop, a query is executed on each interaction and the governor limit is easily reached. Instead move the SOQL query outside of the for loop and retrieve all the necessary data in a single query.
- Avoid Multiple Triggers on the Same Object: Write the Single Trigger on the each object and write the logic in the classes and call that classes in the triggers.
- use of the Limits Apex Methods to avoid Hitting Governor Limits.
- Avoid hardcoding IDs.
64. What is the MVC design pattern in Salesforce.com?
Model View Controller (MVC) design pattern is the one of the most popular design pattern which contains three modules.
- Model.
- View.
- Controller.
- Model: What Schema and Data does salesforce uses to represent the system completely. In Salesforce, we can say that sObject are the model.
- Example: Sobjects, Apex Classes.
- View: How the Schema and data is represented. Visualforce is used to present the data to users.
- Example: Pages, Components.
- Controller: How the interface actions. Controllers are used to perform the actions whenever users interact with Visualforce.
- Example: Standard, Custom(Apex).
65. How many records we can display in the particular report?
Any number of records.
66. What are the data components in the Dashboards?
The following are the Data Components in the Dashboards.
- Horizontal Bar Chart.
- Vertical bar Chart.
- Line Chart.
- Pie Chart.
- Donut Chart.
- Funnel Chart.
- Gauge Chart.
- Metric.
- Table.
Note: The Components of the Dashboard that use the Grand Totals is Metric and Gauge.
67. How to call method in VF page?
We have a attribute called action in the <apex:commnadbutton> tag in the VF page.
<apex:commandButton action=”{!save}” value=”Save” id=”theButton”/>.
68. How much code coverage we can do for a Test Class?
- 75%.
69. What is the Formula Filed?
A read-only field that derives its value from a formula expression which we define. The formula filed is updates when any of the source field change.
70. Mention the names of Standard Controllers?
- Accounts.
- Contacts.
- Opportunities.
- Leads…etc.
80. What are the actions in Workflow?
- Tasks.
- Email Alert.
- Field Update.
- Outbound Message.
81. Can we delete a record using the Workflow?
- No.
82. What is the validation Rule?
- Validation rule verify that the data a user enters in a record meets the standards we specify before the user can save the record.
- Validation rule also included the error message to display to the user when the rule returns a value of the true due to an invalid value.
83. If we don’t have 75%code coverage, can we move it from one sandbox to another sandbox?
Yes, we can move a class from one Sandbox to another sandbox. But if we want to move a class from sandbox to environment we need to have a Test Class with a minimum of code coverage should be 75%.