1. What is the App?
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 customize 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 the Tab?
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. What is the object?
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.
4. Master-detail Vs Lookup?
Author: Lookup
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
when create records it's Optional
The OWD’s cannot be inherited from the Parent object if we have lookup relationship between them
it's Editable field
Master Detail
We can create upto2 Master-Detail Relationships
Master- Detail Relationship cannot be created if records already exists
If we deletes the Parent record, then the Childs will be deleted
when creates recoreds it's Mandatory
The OWD’s can be inherited from the Parent object if we have lookup relationship between them
it's Read Only field
we can create a rollup summary
5. External ID & Unique ID
Author:
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
6. Difference between WhoId & WhatId?
Author:
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
7. What is the page layout ?
Author:
Page layouts control the layout and organization of buttons, fields, s-controls, Visualforce, custom links, and related lists on object record pages. They also help determine which fields are visible, read-only, and required. Use page layouts to customize the content of record pages for your users.
8. What is the search layout?
Author:
Record types allow you to associate different business processes and subset of pick list value to different users based on their user profile. They are used to drive which page layouts users see when viewing records, based on their user profile
9. Record type
Author:
Record types allow you to associate different business processes and subset of pick list value to different users based on their user profile. They are used to drive which page layouts users see when viewing records, based on their user profile
10. Create m-m relationships between object?
Author:
It supports upto 5 million records.
It supports almost all standard and custom objects.
It doesn’t support schedule export.
While importing, duplicates cannot be ignored.
Import Wizard
It supports only up to 50000.
It supports Custom objects but only few Standard objects like Accounts, Solutions, Leads and Contacts.
It supports schedule export.
Delete operation is not available.
While importing, duplicates can be ignored.
11. Data loader vs import wizard
Author:
It supports upto 5 million records.
It supports almost all standard and custom objects.
It doesn’t support schedule export.
While importing, duplicates cannot be ignored.
Import Wizard
It supports only up to 50000.
It supports Custom objects but only few Standard objects like Accounts, Solutions, Leads and Contacts.
It supports schedule export.
Delete operation is not available.
While importing, duplicates can be ignored.
12. Bypass Validation
Author:
Introduce a dummy checkbox field that is not visible to anyone. And let the Validation Rule bypass the record if that checkbox is true. Now, in your trigger before you update oppsToUpdate, first update that dummyCheckbox to true. In this way, the validation rule will be bypassed. Also, make sure you make the checkbox false as soon as the trigger does its action. In order to do this, you can create a workflow that will do the field update of that dummy checkbox to false whenever the value is true.
13. Isblack & Isnull ?
prabhakarreddy kv: ISBLACK
Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
ISNULL
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE
NOTE
Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports text fields. Salesforce will continue to support ISNULL, so you do not need to change any existing formulas
14. What is Validation rules ?
Author:
Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of "True" or "False." Validation rules also include an error message to display to the user when the rule returns a value of "True" due to an invalid value.
15. What are custom formula fields?
Author:
Formula Fields are the read-only field,
Formula Fields are used for calsulation and metrics to your business.
Just as you can use a spreadsheet program like Microsoft Excel
Data types is: Number,Text ,Date , DateTime ,currency ,percent .
16. Roll up summary field in Salesforce?
Author:
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.
17. Master-Detail vs Look up relations
Author:
Master Detail relationship is the Parent and 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.
18. What is work flow?
Author:
Workflow is a business-logic engine that allows us to automatically send email alerts, assign tasks, or update field values based on rules that we define. Any time that changes to a record meet the conditions in a workflow rule, the platform automatically performs any actions associated with the rule.
19. Evalution cretiria
Author:
Email Alerts—Send an email to one or more recipients. For example, automatically send sales management an email alert when a sales representative qualifies a large deal.
Tasks—Assign a new task to a user, role, or record owner. For example, automatically assign follow-up tasks to a support representative one week after a case is updated.
Field Updates—Update the value of a field on a record. For example, automatically change the Owner field on a contract three days before it expires.
Outbound Messages—Send a secure configurable API message (in XML format) to a designated listener. For example, automatically initiate the reimbursement process for an approved expense report by triggering an outbound API message to an external HR system.
20. What is workflow actions?
Author:
Email Alerts—Send an email to one or more recipients. For example, automatically send sales management an email alert when a sales representative qualifies a large deal.
Tasks—Assign a new task to a user, role, or record owner. For example, automatically assign follow-up tasks to a support representative one week after a case is updated.
Field Updates—Update the value of a field on a record. For example, automatically change the Owner field on a contract three days before it expires.
Outbound Messages—Send a secure configurable API message (in XML format) to a designated listener. For example, automatically initiate the reimbursement process for an approved expense report by triggering an outbound API message to an external HR system.
21. What is time depend workflow?
Author:
time-dependent workflow actions are actions that occur before or after a certain amount of time has elapsed
We can use time-dependent workflow actions to fire tasks, field updates, and email alerts while the condition of a workflow rule remains true.
22. Null pionter exception in PB
Author:
If possible, use filter criteria instead of formula criteria, being sure to include a criteria to check that the relationship field is not null prior to making a cross-object reference across that relationship.
As an example, for the criteria given in repro steps above, filter criteria could be used like:
---
1. [Contact].ReportsTo is null boolean False AND
2. [Contact].ReportsTo.Description isnull boolean true
Workaround is not valid for cross-object picklist fields referenced in a cross-object formula criteria when the relationship field doesn’t have value
23. Process Builder
Author:
Process Builder lets you automate business processes using a visual interface.
Processes allow you to execute actions when certain conditions are met.
You can add multiple groups of criteria and associate actions with each criterion.
You can create immediate andscheduled actions.
You can use versioning to easily track and maintain processes.
24. Action support process builder
Author:
Create a record: Create a new record.
Update records: Update fields on records or any related records.
Send an email: Send an email using an email alert.
Post to Chatter: Post to the feed of a user, a Chatter group, or the record that started the process.
Use a quick action: Use an object-specific or global action to create a record, update a record, or log a call.
Submit for approval: Submit a record for approval without requiring users to submit manually.
Launch a flow: Trigger an auto launched flow to automate complex business processes.
Call Apex: Call an Apex method to add customized functionality.
25. What is approval process?
Author:
Approval processes allow you to specify a sequence of steps that are required to approve a new record. Each step allows one or more designated approvers to accept or reject a record The steps can apply to all records included in the process, or just to records that meet certain requirements approval processes allow you to specify actions—like sending an email alert, updating a field value, or assigning a task—that should occur whenever a record is approved, rejected, first submitted for approval, or recalled.
26. Dynamic approval process?
Author:
Allowcate the approval dynamically in the record. populate the approvers in the user lookup fields in the record, Approver name are define dynamically in the object
27. What is report?
Author:
A report return a set of records that meet certain criteria and display it in organization rows and column. Report data can be filtered, group and displayed graphically as a char.
In reports data displayed is as per running user's security access. Reports can be run on both standard and custom objects. Reports are stored in folders. Users with access to these folders can run the reports.
28. Types of report?
Author:
A report return a set of records that meet certain criteria and display it in organization rows and column. Report data can be filtered, group and displayed graphically as a char.
In reports data displayed is as per the running user's security access. Reports can be run on both standard and custom objects. Reports are stored in folders. Users with access to these folders can run the reports.
29. Who is running user?
Author:
The user whose security settings determine what data is displayed in a dashboard.
Because only one running user is specified per dashboard, everyone who can access
the dashboard sees the same data, regardless of their personal security settings.
30. What is dashboard?
Author:
A dashboard is the graphical representation of the data generated by a report (or multiple reports) at certain point in time. So it's a snapshot of data, to obtain the latest data you need to refresh them either manually or in a scheduled manner.
31. What is dashboard components?
Author:
Charts:Displays a bar, column, line, pie, donut, or funnel chart—or any chart contained in a report.
Tables:Displays a table that contains values and totals from columns in the report
Metrics:Displays the grand total from a report, along with a label that you enter.
Gauges:Shows the grand total of a report as a point on a “fuel-tank” type of scale.
Visualforce pages:Displays any Visualforce dashboard component in your organization.
32. Report type
Author:
The report type you choose determines which records and fields appear in your report
Standard report types give you access to most Salesforce data. For example, the Opportunities report type gives you access to Opportunity records and fields in your report. If you’re going to report on Opportunity Amounts or Probability or Type, then Opportunities is the report type is for you.
Custom report types give you access to custom objects in Salesforce, or custom views of standard objects (like Opportunities), which your administrator configures. For example, your administrator can create a custom report type which gives access to Opportunities, plus related fields from Products. With that custom report type, you can easily report on Opportunities for a given product.
33. Schema builder
Author:
Schema Builder provides a dynamic environment to add new custom objects, custom fields, and relationships ( to your schema ).
This eliminates the need to click from page to page to find the details of a master-detail relationship or to add a new custom field to an object in your schema. For example, if you’re using Schema Builder to view the details of your schema, you can add a new custom object without leaving Schema Builder. The drag-and-drop interface lets you easily add a custom object or new field, and saves the layout of your schema any time you move an object.
34. Report type
Author:
Charts:Displays a bar, column, line, pie, donut, or funnel chart—or any chart contained in a report.
Tables:Displays a table that contains values and totals from columns in the report
Metrics:Displays the grand total from a report, along with a label that you enter.
Gauges:Shows the grand total of a report as a point on a “fuel-tank” type of scale.
Visualforce pages:Displays any Visualforce dashboard component in your organization.
ADMIN
1. What is profile?
Author:
A profile is a group/collection of settings and permissions that define what a user can do in salesforce. A profile controls “Object permissions, Field permissions, User permissions, Tab settings, App settings, Apex class access, Visualforce page access, Page layouts, Record Types, Login hours & Login IP ranges.
2. What is standard profiles ?
Author:
Read Only : Can only view records
Standard User :Can view, edit and delete their own records
Marketing User : Standard User Permissions + can import leads for the organization
Contract Manager :Standard User Permissions + can edit, approve, activate and delete contracts
Solution Manager : Standard User Permissions + can manage published solutions + can manage solution categories
System Administrator: Super User Can customize and administer the application
3. Transfer Record in profile
Author:
If user have only Read access on particular record but he wants to change the owner name of that record, then in profile level Transfer Record enables he can able to change the owner.
3. Transfer Record in profile
Author:
If user have only Read access on particular record but he wants to change the owner name of that record, then in profile level Transfer Record enables he can able to change the owner.
4. Diff Role vs Profile ?
Author:
Role is a component of record-level access, which is not mandatory for users. Profile is a component of field-level access, which is mandatory for all users.
5. What is role ?
Author:
Controls data visibility
Controls record roll up – forecasting and reporting
Users inherit the special privileges of data owned by or shared with users below them in the hierarchy
Not necessarily the company’s organization chart
6. Role Hierachy?
Author:
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
7. What is permessionset ?
Author:
OWD Defines the baseline level of access to data records for all users in the Organization (not including records owned by the user or inherited via role hierarchy) Used to restrict access to data Access levels to
Private
Public Read/Write
Public Read/Write/Transfer
Public Full Access
Public Read Only
8. What is OWD ?
Author:
OWD Defines the baseline level of access to data records for all users in the Organization (not including records owned by the user or inherited via role hierarchy) Used to restrict access to data Access levels to
Private
Public Read/Write
Public Read/Write/Transfer
Public Full Access
Public Read Only
9. Object-Level Security
Author:
The bluntest way that we can control data is by preventing a user from
seeing, creating, editing, and/or deleting any instance of a particular type
of object, like a position or review. Object-level access allows us to hide
whole tabs and objects from particular users, so that they don't even know
that type of data exists. On the platform, we set object-level access rules with object permissions on user profiles.
10. Field-Level Security
Author:
A variation on object-level access is field-level access, in which a user can
be prevented from seeing, editing, and/or deleting the value for a particular
field on an object. Field-level access allows us to hide sensitive information
like the maximum salary for a position or a candidate's social security
number without having to hide the whole object.
On the platform, we set field-level access rules with the field-level security.
11. Record-Level Security
Author:
To control data with a little more finesse, we can allow particular users to view an object, but then restrict the individual object records that they're allowed to see. For example, record-level access allows an interviewer like Melissa Lee to see and edit her own reviews, without exposing the reviews of everyone else on her team.
On the platform, we actually have four ways of setting record-level access
rules:
• Organization-wide defaults allow us to specify the baseline level of access that a user has in your organization. For example, we can make
it so that any user can see any record of a particular object to which their user profile gives them access, but so that they'll need extra
permissions to actually edit one.
• Role hierarchies allow us to make sure that a manager will always have access to the same records as his or her subordinates.
• Sharing rules allow us to make automatic exceptions to organization-wide defaults for particular groups of users.
• Manual sharing allows record owners to give read and edit permissions to folks who might not have access to the record any other way.
12. What are Role Hierarchies?
Author:
Role hierarchies allow us to make sure that a manager will always have
access to the same records as his or her subordinates.
The first way that we can share access to records is by defining a role hierarchy. Similar to an org chart, a role hierarchy represents a level of data access that a user or group of users needs.Users assigned to roles near the top of the hierarchy (normally the CEO, executives, and other management) get to access the data of all the users who fall directly below them in the hierarchy.The role hierarchy ensures that a manager will always have access to the same data as his or her employees, regardless of the org-wide default settings. Role hierarchies also helpfully define groups of users who tend to need access to the same types of records
13. What are sharing rules
Author:
Sharing rules allow us to make automatic exceptions to organization-wide defaults for particular groups of users.
The thing to remember with sharing rules is that, like role hierarchies, we can use them only to open up record access to more users. Sharing rules and role hierarchies can never be stricter than our org-wide default settings.
14. What is Manual Sharing
Author:
Manual sharing allows record owners to give read and edit permissions
to folks who might not have access to the record any other way.
15. Securities in salesforce?
Author:
in salesforce securities are provided by
1). By profiles
2).by permission sets.
3).by OWDs base level of access to objects
4).by sharing rules.
5).by roles and role hierarchy.
16. Understanding Sharing
Sharing enables record-level access control for all custom objects, as well as many standard objects (such as Account, Contact, Opportunity and Case).
Administrators frst set an object’s organization-wide default sharing access level, and then grant additional access based on record ownership, the role hierarchy, sharing rules, and manual sharing.
Developers can then use Apex managed sharing to grant additional access programmatically with Apex. Most sharing for a record is maintained in a related sharing object, similar to an access control list (ACL) found in other platforms.
17. What is group?
Author:
A group consists of a set of users. A group can contain individual users, other groups, or the users in a particular role or territory. It can also contain the users in a particular role or territory plus all the users below that role or territory in the hierarchy.
18. What is public group ?
Author:
A public group is a set of users. It can contain individual users, other groups, individual roles, or roles with their subordinates that all have a function in common
19. What is queue?
Author:
Queues allow groups of users to manage a shared workload more effectively. A queue is a location where records can be routed to await processing by a group member. The records remain in the queue until a user accepts them for processing or they are transferred to another queue. You can specify the set of objects that are supported by each queue, as well as the set of users that are allowed to retrieve records from the queue.
20. How to delete users data from SF?
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.
21. View all and modify all
Author:
The “View All” and “Modify All” permissions ignore sharing rules and settings, allowing administrators to grant access to records associated with a given object across the organization. “View All” and “Modify All” can be better alternatives to the “View All Data” and “Modify All Data” permissions.
22. View All Data / View All Permission
Author:
View All Permission on Object will give you "View Access to All records of the Object"
View All Data will give you permission to all records in the system across all objects
23. Diff ways Sharing records
Author:
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 troles -> 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 to share a record to a particular user manually.
Go to detail page of record and click on manual sharing button and assign that record to other user with Read or Read/Write access.
Manual Sharing button enables only when OWD is private to that object.
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.
24. Governer Limits
Srikanth Gujja:In Salesforce, it is the Governor Limits which controls how much data or how many records you can store in the shared databases.
To make sure no single client monopolizes the shared resources, Salesforce introduced the concept of Governor Limits which is strictly enforced by the Apex run-time engine.
24. Governer Limits
Srikanth Gujja:In Salesforce, it is the Governor Limits which controls how much data or how many records you can store in the shared databases.
To make sure no single client monopolizes the shared resources, Salesforce introduced the concept of Governor Limits which is strictly enforced by the Apex run-time engine.
25. Full config dev storage limit
Author:
Full Copy Sandbox has the same storage limit as your production organization
Configuration Only sandbox has the storage limit of 500MB
Developer Sandbox has the storage limit of 10MB
26. Full config dev interval refresh time
Author:
Full Copy Sandbox can be refreshed once in 29 days
Configuration Sandbox can be refreshed once per day
Developer Sandbox can be refreshed once per day
27. Salesforce to Salesforce
Author:
you have to enable it. This has to be done in both the orgs by Users (usually System Administrators) who have "Manage Connections" permission on their profile.
Once enabled in your org, you can customize the invitation by modifying the From email address, Display name and Email templates used for sending the invitation emails.
.Go to Connections tab
.click new button create new connection to other org and send invitation
. Publish objects click on Publish in the Connection tab
.Subscribing to Published Objects
.Field Mappings considerations
CRM
1. Types of Account
Author:
We have two types of accounts.
Personal accounts
Business accounts
In personal accounts, person’s name will be taken as primary considerations where as in business accounts company name will be taken into consideration.
2. Accounts overview
Accounts are your organization's customers, competitors, and partners.
Each account stores information such as name, address, and phone numbers.
For each account, you can store related information such as opportunities, activities, cases, partners, contracts, and notes.
The Accounts tab displays a home page that lets you quickly create and locate all types of accounts. You can also sort and filter your accounts using standard and custom list views.
In addition, this tab lets you view and edit detailed information on each account to which you have access.
If, organization has been enabled with person accounts, you have two different kinds of accounts: business accounts and person accounts. Business accounts represent the other companies with which your organization does business. For business accounts, the individuals who work at those companies are represented by contacts. Person accounts represent the individual consumers with whom your company does business, such as a financial services client, an online shopper, or a vacation traveler. Depending on your organization's business model, you may use business accounts, person accounts, or both.
If, organization has a partner portal, you can create partner accounts. Partner accounts are business accounts that a channel manager uses to manage partner organizations, partner users, and activities.
3. Business Account
To create a new account, select Account from the Create New drop-down list in the sidebar, or click New next to Recent Accounts on the accounts home page. If your organization has enabled person accounts, you must first specify whether the record type is a business account or person account. Next, enter the information for the account. Click Save when you are finished, or click Save & New to save the current account and add another.
To specify that a business account is a subsidiary of another business account, fill in the Parent Account field. You can then view a hierarchy of account relationships. The Parent Account field is not available for person accounts.
Use the Account Site field to designate different locations of the same company. For example, Acme.com may have offices in Paris and London. Create two accounts, both called Acme.com, but with Account Site values of Paris and London, respectively.
If Quick Create has been enabled by your administrator, you can add a new account from the Quick Create area in the sidebar on the accounts home page. Fill in the fields to add a new account. If your organization uses person accounts and your default record type for the Accounts tab is a person account record type, then the Quick Create fields include First Name and Last Name instead of Account Name.
Enterprise, Unlimited, and Developer Edition organizations can activate record types and ask you to choose a Record Type when creating an account. This determines the picklist values available when creating and editing a record.
If your organization uses divisions, the division of a new account is automatically set to your default division, unless you manually select a different one.
If your organization uses territory management, account assignment rules can automatically assign newly created accounts to territories. See Territory Management Overview.
4. Delete account
To delete an account, click Del next to the account on the accounts list page, or click Delete on the account detail page.
When you delete an account it's moved to the Recycle Bin along with any of these related items:
■Contacts
■Opportunities
■Contracts (if they're not activated)
■Activities
■Notes
■Attachments
■Portal roles and groups (if all portal users in the account are disabled)
■Partner relationships
■Relationship group members
If you undelete an account, any related items are also restored except for:
■Relationship group members in some cases. See Removing Members from Relationship Group Members.
■Portal roles and groups. See Using Accounts.
You can't delete an account if it has been enabled as a partner account, has associated cases, activated contracts, related opportunities that are owned by other users, or associated contacts are enabled for the Self-Service portal. In addition, if you attempt to delete an account that has closed/won opportunities owned by you, a message displays asking you whether you want to delete the closed/won opportunities along with the account or to cancel the account deletion.
5. Contacts overview
Contacts are all of the individuals associated with business accounts that need to track in Salesforce.
You can store various information for a contact, such as phone numbers, addresses, titles, and roles in a deal.
The Contacts tab displays a home page that lets you quickly create and locate contacts. You can also sort and filter contacts using standard and custom list views. In addition, this tab lets you view and edit detailed information on each contact to which you have access.
6. Creating Contacts
To create a contact, select Contact from the Create New drop-down list in the sidebar, or click New next to Recent Contacts on the contacts home page. Enter the information for the contact. Click Save when you are finished, or click Save & New to save the current contact and add another.
To automatically associate a contact with an account, view the account and click New Contact in the task bar. You can also select New in the Contacts related list of an account.
If Quick Create is enabled by your administrator, you can also add a contact on the contacts home page.
Enterprise, Unlimited, and Developer Edition organizations can activate record types and ask you to choose a Record Type when creating a contact. This determines the picklist values available when creating and editing a record.
If your organization uses divisions, the division of a new contact is automatically set to the division of the related account.
Note
Contacts that are not linked to an account are always private, regardless of your organization’s sharing model. Only the owner of the contact and administrators can view it. Sharing rules and workflow rules do not apply to private contacts. If your organization uses divisions, private contacts always belong to the global division.
7. Deleting contacts
To delete a contact, click Del next to the contact on the contacts list page or in the Contacts related list of an account. You can also delete a contact by clicking Delete on the contact detail page.
When you delete a contact, all related assets, campaign history, events, tasks, notes, and attachments are also deleted.
You do not need the “Delete” permission on any associated records that are included in the deletion. Associated opportunities, accounts, entitlements, and cases are not deleted with the contact. The deleted contact is moved to the Recycle Bin. If you undelete the contact, any related items are also restored including any inactive Self-Service username.
You cannot delete contacts that have associated:
■Cases
■Contracts
■Service contracts
■Partner user
■Assets with cases
■An active Self-Service user
■An active Customer Portal user
Note
You can delete a contact if you are an administrator, the contact owner, or a user above the contact owner in the organization role hierarchy, and if you have the appropriate user permission.
7. Deleting contacts
To delete a contact, click Del next to the contact on the contacts list page or in the Contacts related list of an account. You can also delete a contact by clicking Delete on the contact detail page.
When you delete a contact, all related assets, campaign history, events, tasks, notes, and attachments are also deleted.
You do not need the “Delete” permission on any associated records that are included in the deletion. Associated opportunities, accounts, entitlements, and cases are not deleted with the contact. The deleted contact is moved to the Recycle Bin. If you undelete the contact, any related items are also restored including any inactive Self-Service username.
You cannot delete contacts that have associated:
■Cases
■Contracts
■Service contracts
■Partner user
■Assets with cases
■An active Self-Service user
■An active Customer Portal user
Note
You can delete a contact if you are an administrator, the contact owner, or a user above the contact owner in the organization role hierarchy, and if you have the appropriate user permission.
8. Opportunities
Opportunities are the sales and pending deals that you want to track.
By adding opportunities, you are also building your “pipeline,” which will contribute to your forecast.
You can also link opportunities to campaigns to help measure the ROI of your marketing programs. In addition, you can create quotes, which show proposed prices for products and services, from an opportunity.
The Opportunities tab displays a home page that lets you quickly create and locate opportunities. You can also sort and filter opportunities using standard and custom list views. In addition, this tab lets you view and edit detailed information on each opportunity to which you have access.
9. Opportunities Creation
To create a new opportunity, select Opportunity from the Create New drop-down list in the sidebar, or click New next to Recent Opportunities on the opportunities home page. Enter the information for the opportunity. Click Save when you are finished, or click Save & New to save the current opportunity and add another. If enabled for your organization, click Save & Add Product to save the new opportunity and add a product.
To associate an opportunity with an account or contact, view the existing account or contact, and select Opportunity from the Create New drop-down list in the sidebar. You must have at least read access to the account or contact in order to associate an opportunity with it. When you create an opportunity from a contact detail page, that contact is automatically listed as the primary contact in the Contact Roles related list of the opportunity.
If Quick Create is enabled by your administrator, you can also add a new opportunity on the opportunities home page.
If your organization uses multiple currencies, your opportunity amounts are initially shown in your personal currency. Change the Opportunity Currency picklist if you want to track the sales revenue in another currency.
Enterprise, Unlimited, and Developer Edition organizations can activate record types and ask you to choose a Record Type when creating a record. Record types determine the picklist values and business processes available when you create or edit a record.
If your organization uses territory management, opportunities that you create are automatically assigned a territory when both of the following conditions are met:
■You belong to or have edit privileges on the same territory as the account on the opportunity.
■You have no other territories in common with that account.
For example, if you are in the territories Berkeley and San Francisco and the account is in the territories Portland, San Francisco, and Seattle, the opportunity will be assigned to the San Francisco territory.
If your organization uses divisions, the division of a new opportunity is automatically set to the division of the related account.
Note
In Professional, Enterprise, Unlimited, and Developer Editions, opportunities you create are automatically given the forecast category that corresponds to the opportunity stage you assign. Your administrator correlates opportunity stages and forecast categories when editing the Stage picklist values.
If the opportunity is set to close in a given month, as determined by the Close Date, the opportunity is automatically added to the forecast for that particular month, unless you assign it the Omitted category while editing the forecast. See Displaying and Editing Forecasts.
10. Deleting opportunity
To delete an opportunity, click Del next to the opportunity on the opportunities list page or in the Opportunities related list of an account or contact. You can also delete an opportunity by clicking Delete on the opportunity detail page.
When you delete an opportunity, all related notes, attachments, quotes, quote line items, quote PDFs, events and tasks, partner relationships, competitor strengths/weaknesses, contact roles, and stage history are deleted.
Associated contacts and accounts are not deleted with the opportunity. The deleted opportunity is moved to the Recycle Bin. If you undelete the opportunity, any related items are also restored.
Note
You can delete an opportunity if you are an administrator, the opportunity owner, or a user above the opportunity owner in the organization role hierarchy, and you have the “Delete” permission on opportunities
11. Campaigns Overview
A campaign is an outbound marketing project that you want to plan, manage, and track within Salesforce. It can be a direct mail program, seminar, print advertisement, email, or other type of marketing initiative. You can organize campaigns into hierarchies for easy analysis of related marketing tactics.
The Campaigns tab displays a home page that lets you quickly locate and report on campaigns. You can also sort and filter campaigns using standard and custom list views. In addition, this tab lets you view and edit detailed information on campaigns.
Note
To manage campaigns, users must have the Marketing User checkbox selected on their personal information page, the appropriate user permissions, and sharing access to the campaign. Other users can only view campaigns and run campaign reports. See Who has access to campaigns?.
In addition, campaigns cannot be disabled for your organization if campaigns are referenced in Apex. For more information, see Force.com Apex Code Overview.
12. Campaigns Creation
To create a campaign:
1.Select Campaign from the Create New drop-down list in the sidebar or click New next to Recent Campaigns on the campaigns home page.
2.Choose the following, then click Continue:
■A campaign record type, which determines the page layout and picklist values for the campaign
■A campaign member type, which determines the page layout for members of the campaign
Note
These options are only available if your organization has two or more campaign record types or campaign member record types, respectively. To skip this step, set up default record types.
3.Enter information for the campaign.
4.Click Save, or click Save & New to save the campaign and add another.
Note
New campaigns have two default member status values: “Sent” and “Responded”. You can edit them or create new ones as needed.
13. Delete campaigns
To delete a campaign, click Del next to the campaign on the campaigns list page. You can also delete a campaign by clicking Delete on the campaign detail page.
When you delete a campaign, all related events, tasks, and attachments are also deleted. Associated contacts, leads, person accounts, and opportunities are not deleted with the campaign. The deleted campaign is moved to the Recycle Bin. If you undelete the campaign, any related items are also restored.
14. Assets
While products represent the items that your company sells, assets represent the specific products your customers have purchased, including a serial number, date of purchase, or any other information related to an individual sale. Depending on how your organization uses assets, they can represent a competitor product that your customer has or versions of your products.
Use assets to store specific information about the products your customers have. Depending on your page layouts, you can view asset related lists on your account, contact, and product page layouts.
If set up by an administrator, your customers may be eligible for support based on an asset they've purchased. See Entitlement Management Overview.
15. Assets deletion
Since assets are related to account and contact records, you can delete them from those records or individually using the Products tab. Before you delete an asset, review the following scenarios:
■Is the asset associated with a case?
Assets associated with cases cannot be deleted. This includes deleting an account or contact record that is associated with an asset listed on a case.
■Is the asset associated with a product?
When an asset is based on a product, deleting the product does not delete the asset.
■Is the asset associated with an account or contact?
If you delete an account or contact, all associated assets are also deleted and moved to the Recycle Bin.
Note that if you delete an account with a related contact that is associated with an asset, all three records are deleted. To restore all three records, restore the account record.
Note
You can delete an asset individually without deleting any related record. However, if you later delete the related record, you cannot recover the asset from the Recycle Bin.
To delete an asset:
1.Locate the asset on the Assets related list of an account or contact, or on an asset list view from the Products tab.
2.Click Del next to the asset you want to delete.
3.Click OK.
15. Assets deletion
Since assets are related to account and contact records, you can delete them from those records or individually using the Products tab. Before you delete an asset, review the following scenarios:
■Is the asset associated with a case?
Assets associated with cases cannot be deleted. This includes deleting an account or contact record that is associated with an asset listed on a case.
■Is the asset associated with a product?
When an asset is based on a product, deleting the product does not delete the asset.
■Is the asset associated with an account or contact?
If you delete an account or contact, all associated assets are also deleted and moved to the Recycle Bin.
Note that if you delete an account with a related contact that is associated with an asset, all three records are deleted. To restore all three records, restore the account record.
Note
You can delete an asset individually without deleting any related record. However, if you later delete the related record, you cannot recover the asset from the Recycle Bin.
To delete an asset:
1.Locate the asset on the Assets related list of an account or contact, or on an asset list view from the Products tab.
2.Click Del next to the asset you want to delete.
3.Click OK.
Normal Apex faq's Variable's
1. Apex Properties
An Apex property is similar to a variable, however, you can do additional things in your script to a property value before it is
accessed or returned. Properties can be used in many different ways: they can validate data before a change is made; they can
prompt an action when data is changed, such as altering the value of other member variables; or they can expose data that is
retrieved from some other source, such as another class.
Property definitions include one or two code blocks, representing a get accessor and a set accessor:
• The code in a get accessor executes when the property is read.
• The code in a set accessor executes when the property is assigned a new value.
A property with only a get accessor is considered read-only. A property with only a set accessor is considered write-only.
A property with both accessors is read-write.
To declare a property, use the following syntax in the body of a class:
Public class BasicClass {
// Property declaration
access_modifier return_type property_name {
get {
//Get accessor code block
}
set {
//Set accessor code block
}}}
• access_modifier is the access modifier for the property. All modifiers that can be applied to variables can also be applied to properties. These include: public, private, global, protected, static, virtual, abstract, override, and transient. For more information on access modifiers,
• return_type is the type of property, such as Integer, Double, subject, and so on.
• property_name is the name of the property
2. with sharing and without sharing
With sharing: Use the with sharing keywords when declaring a class to enforce the sharing rules that apply to the current user.
Without sharing: Use the without sharing keywords when declaring a class to ensure that the sharing rules for the current user are not enforced
3. What is Apex ?
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com API. Using syntax that looks like Java and acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pages. Apex code can be initiated by Web service requests and from triggers on objects.
4. What is the dynamic Apex?
Dynamic Apex enables developers to create more flexible applications by providing them with the ability to “Access subject and field describe information”, “Write Dynamic SOQL Queries”, “Write Dynamic SOSL Queries” and “Dynamic DML”.
5. How many way we can call the Apex class?
Visualforce page
Trigger
Web Services
Email Services
6. 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.
public SObject getNewSobject(String t)
{
// Call global describe to get the map of string to token.
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
// Get the token for the sobject based on the type.
Schema.SObjectType st = gd.get(t);
// Instantiate the sobject from the token.
Sobject s = st.newSobject();
return s;
}
7. How to get all the fields of the subject using dynamic Apex?
Map<String, Schema.SObjectType> m = Schema.getGlobalDescribe() ;
Schema.SObjectType s = m.get('API_Name_Of_SObject') ;
Schema.DescribeSObjectResult r = s.getDescribe() ;
Map<String,Schema.SObjectField> fields = r.fields.getMap() ;
8. How to get all the required fields of sObject dynamically?
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 has below three properties then it is a mandatory field.
If it is Creatable
If it is not nillable and
If it does not have any default value
view sourceprint?
Map<String, Schema.SObjectType> m = Schema.getGlobalDescribe() ;
Schema.SObjectType s = m.get(so.apiName) ;
Schema.DescribeSObjectResult r = s.getDescribe() ;
Map<String,Schema.SObjectField> fields = r.fields.getMap() ;
for(String f : fields.keyset())
{
Schema.DescribeFieldResult desribeResult = fields.get(f).getDescribe();
if( desribeResult.isCreateable() && !desribeResult.isNillable() && !desribeResult.isDefaultedOnCreate() )
{
//This is mandatory / required field
} }
8. How to get all the required fields of sObject dynamically?
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 has below three properties then it is a mandatory field.
If it is Creatable
If it is not nillable and
If it does not have any default value
view sourceprint?
Map<String, Schema.SObjectType> m = Schema.getGlobalDescribe() ;
Schema.SObjectType s = m.get(so.apiName) ;
Schema.DescribeSObjectResult r = s.getDescribe() ;
Map<String,Schema.SObjectField> fields = r.fields.getMap() ;
for(String f : fields.keyset())
{
Schema.DescribeFieldResult desribeResult = fields.get(f).getDescribe();
if( desribeResult.isCreateable() && !desribeResult.isNillable() && !desribeResult.isDefaultedOnCreate() )
{
//This is mandatory / required field
} }
9. What is a property in Apex? Explain with advantages.
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:
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 members is declared in the Apex class. It has another advantage in the “number of lines of code” limit by salesforce which will drastically reduce.
10. Difference Database.insert vs insert
Author:
1. insert is the DML statement which is same as databse.insert.
2.However, database.insert gives more flexibility like rollback, default assignment rules etc.
3.we can achieve the database.insert behavior in insert by using the method setOptions(Database.DMLOptions)
Important Difference:
--> If we use the DML statement (insert), then in bulk operation if error occurs, the execution will stop and Apex code throws an error which can be handled in try catch block.
--> If DML database methods (Database.insert) used, then if error occurs the remaining records will be inserted / updated means partial DML operation will be done.
11. How to read the parameter value from the URL in Apex?
Consider that the parameter name is “RecordType”.
view sourceprint?
String recordType = Apexpages.currentPage().getParameters().get('RecordType');
12. How to get the picklist value in Apex class?
Using Dynamic apex, we can achieve this.on object of type pickilist, call getDescribe(). then call the getPicklistValues() method. iterate over result and create a list. bind it to <apex:selectOptions>.
13. 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 the number of records being processed. If code exceeds a limit, the associated governor issues a runtime exception.
14. Explain System.runAs()
Generally, all Apex code runs in system mode, and the permissions and record sharing of the current user are not taken into account. The system method, System.runAs(), 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 only use runAs in a test method. The original system context is started again after all runAs() test methods complete.
Example :
view sourceprint?
System.runAs(u) {
// The following code runs as user 'u'
System.debug('Current User: ' + UserInfo.getUserName());
System.debug('Current Profile: ' + UserInfo.getProfileId()); }
// Run some code that checks record sharing
}
15. Is it possible to write Apex code from UI?
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.
16. Invoking Callouts Using Apex
An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from an Apex script and then receiving the response. Apex provides integration
with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).
Note: Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses.
Two types of callouts
SOAP Services: Defning a Class from a WSDL Document on page 204
Invoking HTTP Callouts on page 211
SOAP Services: Defning a Class from a WSDL Document :
Classes can be automatically generated from a WSDL document that is stored on a local hard drive or network. Creating a class by consuming a WSDL document allows developers to make callouts to the external Web service in their Apex scripts.
Note: Use Outbound Messaging to handle integration solutions when possible. Use callouts to third-party Web
services only when necessary
17. Classes and Casting
In general, all type information is available at runtime.This means that Apex enables casting, that is, a data type of one class
can be assigned to a data type of another class, but only if one class is a child of the other class. Use casting when you want to convert an object from one data type to another.
In the following example, CustomReport extends the class Report.Therefore, it is a child of that class.This means that
you can use casting to assign objects with the parent data type (Report) to the objects of the child data type (CustomReport).
18. final
Using the final Keyword
You can use the final keyword to modify variables.
• 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.
• Static final variables can be changed in static initialization code or where defined.
• Member final variables can be changed in initialization code blocks, constructors, or with other variable declarations.
• To define a constant, mark a variable as both static and final (see Constants on page 41).
• Non-final static variables are used to communicate state at the class level (such as state between triggers). However, they
are not shared across requests.
• 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
19. Instanceof
Using the instanceof Keyword
If you need to verify at runtime whether an object is actually an instance of a particular class, use the instanceof keyword.
The instanceof keyword can only be used to verify if the target type in the expression on the right of the keyword is a viable
alternative for the declared type of the expression on the left.
You could add the following check to the Report class in the classes and casting example before you cast the item back into
a CustomReport object.
If (Reports.get(0) instanceof CustomReport) {
// Can safely cast it back to a custom report object
CustomReport c = (CustomReport) Reports.get(0);
} Else {
// Do something with the non-custom-report.
}
20. Super
Using the super Keyword
The super keyword can be used by classes that are extended from virtual or abstract classes. By using super, you can override constructors and methods from the parent class.
For example, if you have the following virtual class:
public virtual class SuperClass {
public String mySalutation;
public String myFirstName;
public String myLastName;
public SuperClass() {
mySalutation = 'Mr.';
myFirstName = 'Carl';
myLastName = 'Vonderburg';
}
public SuperClass(String salutation, String firstName, String lastName) {
mySalutation = salutation;
myFirstName = firstName;
myLastName = lastName;
}
public virtual void printName() {
System.debug('My name is ' + mySalutation + myLastName);
}
public virtual String getFirstName() {
return myFirstName;
}
}
Best Practices for Using the super Keyword
• Only classes that are extending from virtual or abstract classes can use super.
• You can only use super in methods that are designated with the override keyword
21. This
Using the this Keyword
There are two different ways of using the this keyword.
You can use the this keyword in dot notation, without parenthesis, to represent the current instance of the class in which it
appears. Use this form of the this keyword to access instance variables and methods. For example:
public class myTestThis {
string s;
{
this.s = 'TestString';
}
}
In the above example, the class testThis declares an instance variable s.The initialization code populates the variable using
the this keyword.
Or you can use the this keyword to do constructor chaining, that is, in one constructor, call another constructor. In this
format, use the this keyword with parentheses. For example:
22. 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
defne the types of felds declared in the serializable classes.
Declaring variables as transient reduces view state size. A common use case for the transient keyword is a feld 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
23. Static and Instance
In Apex, you can have static methods, variables, and initialization code, instance methods, member variables, and initialization
code (which have no modifier), and local variables:
• 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 Visualforce page.
• Instance methods, member variables, and initialization code are associated with a particular object and have no defnition
modifer.When you declare instance methods, member variables, or initialization code, an instance of that item is created
with every object instantiated from the class.
• Local variables are associated with the block of code in which they are declared. All local variables should be initialized
before they are used.