Top Banner

of 57

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Object Relationships in Salesforce

4 Replies

Object Relationships in SalesforceA relationship is a bi-directional association between two objects. Relationships allows us to create links between one object and another. The platform supports following relationship types

Master-Detail

Lookup

Many-to-Many

Master-Detail (1:n)A parent-child relationship in which the master object controls certain behaviors of the detail object.

When a record of the master object is deleted, its related detail records are also deleted.

TheOwnerfield on the detail object is not available and is automatically set to the owner of its associated master record. Custom objects on the detail side of a master-detail relationship cannot have sharing rules, manual sharing, or queues, as these require theOwnerfield.

The detail record inherits the sharing and security settings of its master record.

The master-detail relationship field is required on the page layout of the detail record.

By default, records cant be reparented in master-detail relationships. Administrators can, however, allow child records in master-detail relationships on custom objects to be reparented to different parent records by selecting theAllow reparentingoption in the master-detail relationship definition.

You can define master-detail relationships between custom objects or between a custom object and a standard object. However, the standard object cannot be on the detail side of a relationship with a custom object.In addition, you cannot create a master-detail relationship in which the User or Lead objects are the master.

Lookup Relationship (1:n)This type of relationship links two objects together, but has no effect on deletion or security. Unlike master-detail fields, lookup fields are not automatically required. When you define a lookup relationship, data from one object can appear as a custom related list on page layouts for the other object. See theSalesforceonline help for details.

1. Child row not automatically deleted when a parent row is deleted

2. No inherited sharing.

3. 25 lookup relation relationships allowed per object.

4. Lookup field on child not necessarily required.Many-to-ManyYou can use master-detail relationships to modelmany-to-manyrelationships between any two objects. A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.

To create a many-to-many relationship, simply create a custom junction object with two master-detail relationship fields, each linking to the objects you want to relate.

Interview Questions about object relationships in Salesforce:How many relationships included in SFDC & What are they?We are having three types of relationships, they are

Lookup Relationship

Master-Detail Relationship

Many-to-Many relationshipWhat is a Lookup Relationship?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.

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.

Does an object can have both relationships (Lookup Relationship & Master Detail Relationship) at a time?Yes, single object can have both relationships at a time.

What is a Self Relationship?A self Relationship is a lookup relationship to the same object.

Suppose lets take an object Merchandise. Here we can create relationship in between the Merchandise to Merchandise (same object) object. That is called Self Relationship.

What is Many to Many Relationships?Allow for the relationship of two objects in a many-to-many fashion.

How we achieve the Many-to-Many Relationship?By using Junction Object we can achieve this relationship, here junction object is having Master- Detail Relationship with different objects (Ex.Students & Courses). Using this Master to Detail Relationship, we can create the Many-to-Many Relationship in between the objects.

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).

What are the main things need to consider in Lookup Relationship?Loosely coupled, not going to have all the above rules which are existed in master detail relationship.

Self relationship is always lookup to self relation object type. In many to many we actually create a junction object in the middle, it does lookup for the bound objects that are ultimately being bounded in a many to many way.Can we convert the lookup relationship to Master Detail relationship?Yes, We can convert the lookup relationship to master detail relationship only if all the existing record has valid lookup field values.

Can we create Master Detail relationship on existing records?No. first we have to create the lookup relationship then populate the value on all existing record and then convert it.

How to provide Object Permissions?

Leave a reply

Object Permissions

What is object permissions? In salesforce we can provide permissions to object at profile/permissions sets level. Object level we can provide read, create, edit, delete, view all & Modify all permissions in profiles/permission sets.

Screening How To Permissions Tutorial Transfer Data Management Inventory Management Salesforce LearnRead: Users can only read/view records.

Create: Users can read & create records.

Edit: Users can read & Edit.

Delete: Users can read, Edit & delete records.

View All: Users can view all records in the object irrespective of sharing settings.

Modify All: Users can read, edit, delete, view all & modify all (can transfer, approve) irrespective of sharing settings.

Above 6 permissions we can set at object level in profile/permission set. Read, Create, Edit, Delete respects sharing settings. But View all & Modify all overrides sharing settings.

Navigation to provide object permissionsSetup -> Administer -> Manage Users -> profiles -> select the profile you want give object permissions and go to object permissions and provide required object permissions to profile. See the below screen for reference.

How to enable Console Keyboard Shortcuts in Salesforce?

1. Go to Setup --> Build --> Create --> Apps.

2. Open the Console App.

What is the difference between Freeze and Inactivating the user in Salesforce?

Freeze:If an user is freezed,

1. He will not be able to login.2. User license of that user will not be released.

This is mainly used if you want to restrict an user to login during any activity.

Check the below link for Freezing and Unfreezing.

http://www.infallibletechie.com/2013/10/freeze-button-in-salesforce-user-detail.html

Inactivate:If an user is inactivated,

1. He will not be able to login.2. Report will not run, if he/she is set as running user.3. Web to lead and web to case will not work, if he is set as the default creator.4. User license of the inactivates user will be free for other user.

This is mainly done, when the user leaves the organization.

3. Click "Customize keyboard shortcuts" link.

4. Click "Edit".

5. Enable "Keyboard Shortcuts" and click "Save" button.

6. Go to the Console application and click "Show Keyboard Shortcuts".

How to set field dependency in Salesforce?

1. Select the object.

2. Click "Field Dependencies" button.

3. Click "New" button.

4. Select the fields and click "Continue" button.

5. Select the correct values under controlling fields, click "Include Values" button and click "Save" button.

6. Create a new record to test it.

Security Settings in Salesforce

Record level security

1) OWD - Organization Wide Default a) Private b) Public read only c) Public Read/Write d) Public Read/Write/Transfer(Only for Case and Lead) e) Public Full Access(Only for Campaign) 2) Role Hierarchy 3) Sharing Rule 4) Manual Sharing

Object level security

1) Profile a) CRED or CRUD b) View All c) Modify All d) View All Data d) Modify All Data 2) Permission Set

1. Workflow rules can perform which of the following actions using standard Salesforce.com functionality? A. Update a FieldB. Send an Outbound MessageC. Send an EmailD. Create a Task

2. The Organization ID (Org ID) of a sandbox environment is the same as its production environment. A. TrueB. False

3. Jim is a Salesforce.com system administrator for Universal Products Inc (UPI). UPI currently uses org-wide public read/write for accounts. The sales department is concerned with sales reps being able to see each other's account data, and would like sales reps to only be able to view their own accounts. Sales managers should be able to view and edit all accounts owned by sales reps. The marketing department at UPI must be able to view all sales representative's accounts at UPI. What steps must be configured in order to meet these requirements? A. Change Org-Wide Security for Accounts to PrivateB. Add Sharing Rule to Provide Read Access to Marketing for Sales Representative's AccountsC. Configure Roles:Executive-Marketing (Subordinate of Executive)-Sales Management (Subordinate of Executive)--Sales Representatives (Subordinate of Sales Management)D. Create Sharing Rule to allow Sales Management to view/edit Sales Representatives' accounts

4. The Data Loader can be used with Group Edition. A. TrueB. False

5. What type of object relationship best describes the relationship between Campaigns and Leads (using standard Salesforce functionality)? A. Many to ManyB. Many to OneC. One to One

6. Which of the following are valid Salesforce license types? A. Service CloudB. Platform (Force.com)C. Customer PortalD. Gold EditionE. Unlimited EditionF. Platinum Portal

7. Which of the following are either current or future planned offerings by Salesforce.com or its subsidiaries? A. TouchB. Flow / Visual Process ManagerC. HerokuD. Sites / SiteforceE. StartForce

8. Bob is a Salesforce.com consultant and is responsible for the data migration of an implmentation for his client, Universal Systems Inc (USI).

USI wants to migrate contacts and accounts from their legacy CRM system, which has a similar data model (many contacts per one account; primary keys exist on contact and account).

USI has provided Bob an export in CSV format of contacts and accounts of their legacy CRM system. What method should Bob use to migrate the data from the legacy system into Salesforce? A. An ETL or similar data migration tool must be usedB. Create an external ID for account and use the data loader to upsert the data with relationships intactC. Insert accounts into Salesforce and use Excel vlookup to match the legacy ID to the Salesforce ID in order to insert associated contacts

9. Universal Products Inc (UPI) wants to perform a drip marketing campaign on leads generated through website submissions. What is the ideal method to execute this type of campaign? A. Use Salesforce campaign management and series of workflow rulesB. Integrate Salesforce with a 3rd party vendor to perform marketing automationC. Export the data from Salesforce and manually send via 3rd party tool

10. Which of the following are valid ways to migrate metadata? A. Data LoaderB. Change SetsC. Force.com IDED. ANT Migration Toolkit Similar Opportunities in Salesforce

1. Go to Customize -->Opportunities--> SimilarOpportunities.

2. Enable SimilarOpportunitiesand Save.

3. Add the SimilarOpportunitiesrelated list.

4. Click "Find" button to find SimilarOpportunities.

5. Select theOpportunitiesand click "Bookmark" button.

6. Go to the record to view it.

Marketing user checkbox in Salesforce

- Create a new campaign- Edit an existing campaign- Delete an existing campaign- Update campaign statistics- Import leads into a campaign*- Mass update the status for members of a campaign*- Configure advanced campaign setup to define member status values- Run campaign reports across multiple campaigns

* In order to use the campaign import wizards, Marketing Users must also have the Marketing User profile (or the "Import Leads" permission in Enterprise Edition organizations).

Force.com Work Offline

1. Go to My Settings.

2. Select Force.com Connect Offline under Desktop Add-Ons.

3. Click "Click Here" to save the file or you run if you get run option.

4. Select the language.

5. Select the Destination Folder.

6. Click shortcut icon

7. Enter your login credentials.

Mass Transfer records in Salesforce

1. Go to Setup --> Administer --> Data Management --> Mass Transfer Records.

2. Select the object.

3. Enter the criteria and click "Find" button to find the records.

4. Click "Transfer" button to transfer the records.

Storage usage in Salesforce

Storage usage is used to find the organization's storage usage.

Auto response rule in Salesforce

An auto-response rule is a set of conditions for sending automatic email responses to lead or case submissions based on the attributes of the submitted record. Applicable leads include those captured through a Web-to-Lead form. Applicable cases include those submitted through a:

Self-Service portal

Customer Portal

Web-to-Case form

Email-to-Case message

On-Demand Email-to-Case message

You can create as many response rules as you like based on any attribute of the incoming lead or case, but only one rule for leads and one for cases can be active at a time.

1. Create required email templates.

2. Go Setup --> Build --> Customize --> Leads --> Auto-Response Rules.

3. Click "New" button.

4. Give a name, check "Set this as the active Web-to-Lead Auto-Response rule" check box and click "Save" button.

5. Open the Auto - Response Rule.

6. Click "New" to create rule entries.

7. Below is the list of rule entries.

8. Create a sample Lead from Web to Lead form.

Output:

Assignment rule in Salesforce

Create assignment rules to automate your organizations lead generation and support processes. Lead Assignment RulesSpecify how leads are assigned to users or queues as they are created manually, captured from the web, or imported via the lead import wizards. Case Assignment RulesDetermine how cases are assigned to users or put into queues as they are created manually, using Web-to-Case, Email-to-Case,On-Demand Email-to-Case, theSelf-Serviceportal, theCustomer Portal, Outlook, or Lotus Notes.Steps for creating Lead Assignment Rule:1. Go to Setup --> Build --> Customize --> Leads --> Assignment Rule.

2. Click "New" button.

3. Give a name, check "Set this as the active lead assignment rule" check box.

4. Open the assignment rule.

5. Click "New" to create a rule entry.

6. Enter the criteria as per your requirement.

7. Below is the output of my rule criteria.

8. Go to Leads tab. Create a Lead record. Check "Assign using active assignment rule" check box.

Output:

This lead record is assigned to Magulan D because the Lead city is Chennai.Feed Tracking in Salesforce

Using Feed Tracking, users can see updates for records they follow in their Chatter feed.We can track only up to 20 fields per object.

The following standard field types can't be tracked:

Auto-number, formula, and roll-up summary fields

Encrypted and read-only system fields

The Expected Revenue field on opportunities

The Solution Title and Solution Details fields on solutions

It won't show modified values and old values for Multi-Picklist and Long Textarea fields.

1. History tracking shows the following:

2. Prior value - old value.

3. Current value - value.

4. Who has done the changes - person who modified it.

5. When it was changed - date and time of modification.

1. Go to Setup --> Build --> Customize --> Chatter --> Feed Tracking.

2. Enable Feed Tracking, select the fields and click "Save" button.

Output:

How to enable Opportunity split in Salesforce?

1. Go to Setup --> Build --> Customize --> Opportunity --> Opportunity Team.

2. Enable Team Selling.

3. Select the Page Layouts.

4. Go to Setup --> Build --> Customize --> Opportunity --> Opportunity Team --> Opportunity Splits.

5. Enable Opportunity Splits.

6. Select the Page Layouts.

7. Open an opportunity with team members associated with it.

8. Click "Edit Opportunity Splits" button.

9. Enter the details and click "Save" button.

Output:

Console Tab in Salesforce

The console is a tab that combines related records into one screen with different frames so that users have all the information they need when interacting with Salesforce. Common tasks are accomplished with fewer clicks and without much navigation. Administrators choose the information displayed in the console to accommodate varied and evolving business processes.

Setting up and using the Console tab:

1. Click Your Name --> Setup --> Customize --> Agents Console --> Console Layouts.

2. Click "New Button" to create a Console Layout.

3. Enter the layout name and click "Save" button.

4. Open the Console Layout and click "Edit" button in Selected List Views.

5. Add or remove objects that you want users to choose from in the list view of the console and click "Save" button.

6. Go to Create --> Apps.

7. Click "Edit" link to the app in which you want Console tab.

8. Add Console tab to the Selected Tabs and click "Save" button.

9. Go to Console Layout and click "Console Layout Assignment" button.

10. Assign it to the Profiles and click "Save" button.

11. Click "Console" tab to view it.