SALESFORCE INTERVIEW QUESTIONS AND ANSWER
Ans: It is the 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 completely based on Javascript. These S- Controls are deprecated in 2007 because it is not supporting Apex Language properly. Now 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 determined 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}
{!Account.Name}
5. Where to write Visualforce code?
Ans: We can write the code basically in 3 ways
.
a. setup->App Setup->Develop->Pages and create new Visulaforce page.
a. setup->App Setup->Develop->Pages and create new Visulaforce page.
b. Setup -> My Personal Information -> Personal Information -> Edit check the checkbox development mode. When we run the page like this,
https://ap1.salesforce.com/apex/MyTestPage. we will find the Page editor at the
bottom of the page. we can write page as well as the controller class associated with it, there itself.
c. Using EclipseIDEwe can create the Visulaforce page and write the code.
6. What are Apex 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. 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. What are the types of sandboxes and what is the difference?
Ans: Salesforce gives us the ability to create multiple copies of organization in separate environments for a variety of purposes, such as testing and training, without compromising the data and applications in Salesforce production organization. These copies are called sandboxes and are nearly identical to Salesforce production organization Sandboxes are completely isolated from Salesforce production organization, so operations we perform in sandboxes do not affect Salesforce production organization, and vice versa.
The sandbox types are:
Configuration Only: Configuration-only sandboxes copy all of production organization's reports, dashboards, price books, products, apps, and customizations under Your Name ->Setup, but exclude all oforganization's standard and custom object records, documents, and attachments. Creating a configuration-only sandbox can decrease the time it takes to create or refresh a sandbox from several hours to just a few minutes, but it can only include up to 500 MB of data. We can refresh a configuration-only sandbox once per day.
Developer Sandbox: Developer sandboxes are special configuration-only sandboxes intended for coding and testing by a single developer. Just like configuration-only sandboxes, developer sandboxes copy all application and configuration information to the sandbox. Developer sandboxes are limited to 10 MB of test or sample data, which is enough for many development and testing tasks. We can refresh a developer sandbox once per day.Full:Full sandboxes copy entire production organization and all its data, including standard and custom object records, documents, and attachments.
8. How to schedule export or take the backup of salesforce?
Ans: Salesforce allows us to obtain a copy of all data using the data export feature. We can generate backup files manually once every six days or schedule them to generate automatically at weekly or monthly intervals.
The backup file will come to us in the form a zip file that contains all of organization’s data in a set of CSV (comma-separated values) files. If we do not see the data export feature, contact salesforce.com support to have the Data Export Service activated.
The following path will tells us how to schedule the export
Click Setup -> Data Management -> Data Export -> Schedule Export
Note: 1. we have 48 hours from the time we are notified the backup is available to download the backup file.
2. The email notification for backups goes to the email address in Salesforce of the person logged in who schedules the backup
9. Do governor limits apply to sandbox instances?
Ans: Governor Limits do apply to all Salesforce instances (trial, developer, and production or sandbox environments). However code coverage and successful execution of test classes is only enforced when deploying to a production environment.
10. What is difference in ISNULL and ISBLANK?
Ans: Both Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE ISBLANK (expression): The expression allows both number and text fields.
ISNULL(expression): Here the expression allows only number fields.
ISNULL(expression): Here the expression allows only number fields.
11. When we can’t add Time dependent action in Workflow rule?
Ans: We can’t add time-dependent actions to a rule if we choose “Every time a record is created or edited” evaluation rule criteria.
12. What are the types of email templates available in salesforce.com?
Ans: There are four kinds of Email Templates
a. Text
b. HTML with Letter Head
c. Custom HTML
d. Visualforce
a. Text
b. HTML with Letter Head
c. Custom HTML
d. Visualforce
13. What is Roll up summary field in Salesforce?
Ans: A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list. Thus, we can say that Roll up summary field can only be created on Master object.
14. What are the Record Types?
Ans: Record types used to display different picklistvalues and page layouts to different users based on their profiles
15. Have you implemented Record Types in your project?
Ans: Yes, we have created Record Types and we have done Page Layout Assignment also
16. How to make the Record type as a default?
Ans: By using the Profiles.
Go to the particular profile and by using Record Type Settings we can make the Record Type as a default
Go to the particular profile and by using Record Type Settings we can make the Record Type as a default
17. What will happen if the Account is deleted?
Ans:If the Account is deleted then Contact, Opportunity will also be deleted from Salesforce which are related to that Account.
18. How many types of the relationship fields available in Salesforce?
Ans: There are four types of relationships in salesforce
a. Master Detail
b. Many to Many
c. Lookup
d. Hierarchical (It is available only on User Object)
19. What is Hierarchical Relationship? Does you ever used in your project?
Ans:It is the relationship available on User object which allows users to click a lookup icon and select another user from a pop-up list. This type of relationship is a special lookup relationship available only for the user object. It allows creating a Manager Field on the user object to relate another user. This relationship will acts as a Self relationships.
20. How to create many too many relationships between object?
Ans: Create one custom object, which should have autonumber as unique identification and create two Master - Detail relationships for this object. And this Object is called as Junction object.
Frequently Asked Salesforce question In Interview
Frequently Asked Salesforce question In Interview
21. What is JUNCTION object?
Ans:A Junction object is a Custom object with two Master-Detail relationships. Using this custom junction object, we can model a “many-to-many” relationship between two objects.
22. Say If we created a junction object A with masters B and C? Suppose if we try to delete the records in C what happens to the child?
Ans: Childs will also delete as per the properties of Master- Detail relationship.
23. In Which sequence Trigger and automation rules run in Salesforce.com
Ans: The following is the order salesforce logic is applied to a record.
1. Old record loaded from database
2. New record values overwrite old values
3. System Validation Rules
4. All Apex “before” triggers
5. Custom Validation Rules
6. Record saved to database (but not committed)
7. All Apex “after” triggers (EE / UE only)
8. Assignment rules
9. Auto-response rules
10. Workflow rules
11. Escalation rules
12. Parent Rollup Summary Formula value updated (if present)
13. Database commit
24. 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.
25. How to delete the User from Salesforce?
Ans: As per now, salesforce does not allow to delete any user, however we can deactivate the user.
26. How to delete the user’s data from Salesforce?
Ans: To delete the Users Data go to Your Name -> 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.
27. How to restrict the user to see any record let’s say opportunity?
Ans: Set up opportunity sharing to be private in Organization Wide Defaults. If both users are admins or have view all permissions at profile level on opportunity, then that overrides private sharing.
28. What is the difference between trigger.new and trigger.old in Apex?
Ans: Trigger.new : Returns a list of the sObject records which we are going to insert into database 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 sObject records which already there in database
Note that this sObject list is only available in update and delete triggers.
Note that this sObject list is only available in update and delete triggers.
29. How to restrict any Trigger to fire only once?
Ans: Triggers can fire twice, once before workflows and once after workflows. For this, add a static boolean variable to a class, and check its value within the affected triggers.
30. 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
31. How to display error messages in the visualforcepage?
Ans:In Apex use below code to create the error message for visualforce.
Apexpages.addMessage(newApexPages.Message(ApexPages.Severity.ERROR, 'Required fields are missing. ')); |
<apex:pageMessages></apex:pageMessages>
32. What is property in Apex? Explain with advantages.
Ans: Apex mainly consists 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 create the setters and getters for that variable.
Private String name;
Public void setName(String n)
{
Name=n;
}
Public String getName()
{
Return name;
}
However, the Apex introduced the new concept of property from language C# as shown below:publicString name {get; set;}It has another advantage in “number of lines of code” limit by salesforce which will drastically reduced.
Public void setName(String n)
{
Name=n;
}
Public String getName()
{
Return name;
}
However, the Apex introduced the new concept of property from language C# as shown below:publicString name {get; set;}It has another advantage in “number of lines of code” limit by salesforce which will drastically reduced.
33. 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.
34. 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.
35. How to read the parameter value from the URL in Apex?
Ans: Consider that the parameter name is “Test”.
String Test = Apexpages.currentPage().getParameters().get(‘Test’);
36. What is lookup relationship?
Ans: It is the relationship which is used to connect the two objectsProperties of Lookup Relationship:
We can create upto 25 lookup Relationships Lookup can be create if records already exists If we deletes the Parent record, then the Childs will not be deleted Optional The OWD’s cannot be inherited from the Parent object if we have lookup relationship between them Editable field | |
37. What is Master detail Relationship?
Ans:It is the relationship which is used to connect the two objectsProperties of Master-Detail Relationship:
We can create upto2 Master-Detail Relationships Master- Detail Relationship cannot be created if records alread exists If we deletes the Parent record, then the Childs will be deleted Mandatory The OWD’s can be inherited from the Parent object if we have lookup relationship between them Read Only field | |
38. 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.
Ans: We can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field.
No comments