Pages

Wednesday 3 February 2016

Bucketing

Used to group values on the name given.it can be applied only on pick list, number, text fields

How To Create Bucket Fields In Your Salesforce Reports

Another great question has been asked to our certified Salesforce developers. The question was “how do I use bucket fields in my Salesforce reports?”
Bucketing lets you quickly categorize report records without creating a formula or a custom field within Salesforce.When you create a bucket field, you define multiple categories (buckets) that are used to group report values. We have created simple step by step instructions on how to create this report.
If you follow these step by step instructions for creating a bucket field in your Salesforce CRM:
Step 1 – In the report tab click on the “New Report” button
1
Step2 -Select a “Lead”and then create a new report
2;
Step3 - Here you will find the bucket field in the top of list of fields
3
Step4 - Add this “Bucket Field” into your report
4
Step 5 -Here you will get a popup window called “Edit Bucket Field”
Select the lead status in your source column
5
Click on the “New Bucket” button, create your criteria field “Open – Working”. Select two criteria “Open And Working” status
Step6 - Move this field into “Open And Working” Criteria
6
Step7 -Same process for close –converted and closed-Not converted field
Create a “New Bucket Closed” and drag these two closed fields into your closed bucket field
7
Click “OK” and then select the report as a “Summary Report”
Step8– Lastly you will get your report which is separated on the basis of “Open-working” and “Closed” status of bucket field

Creating Dashboards

Creating Dashboards in Salesforce

Once you have created your report, creating dashboards is simply a drag and drop job. One thing you do have to make sure of is that you have created the correct report type. Tabular reports are not going to work with the majority of components unless they have a row limit, then then can work with chart or table components. The majority of the time you are creating reports to work in dashboards you are probably going to be working with summary reports as you are summarising a certain value and then displaying these values in a bar chart, pie chart, pipeline chart etc.
1. So to start off you need to navigate to the reports tab and hit “New Dashboard” directly next to “New Report”. If you don’t have this button here you probably don’t have the correct permissions, best thing to do is get in contact with your System Administrator.
2.  You will then see the layout design manager for your dashboard. On the left hand side you will be able to see the different components you can add to your dashboard. The top two starting from the left are bar charts, a line graph, pie chart, doughnut chart, pipeline funnel, scatter chart, gauge chart, metric and table. For a more detailed explanation of each of these please see Salesforce description Screen Shot 2014-08-06 at 14.37.21here. Ignore the bottom two
3. Once you have chosen your selected component you can simply drag and drop it to your chosen column. This is the first step. The second step is to populate that chart with some data. On the tab next to components you will see datasources. This is a list of all your reports in Salesforce. As a slight tip if you are building a big dashboard it is best to create a new folder so everything is contained. Once you have found your selected report you can simply drag and drop it onto the component and you’re done!

Screen Shot 2014-08-06 at 14.41.53

4. The last step is to simply customise to your liking! If you click on the little spanner within the component you will be direct to a page with two tabs. You can change the Component data and formatting here as well as a change of graph type.
Screen Shot 2014-08-06 at 15.17.06

Screen Shot 2014-08-06 at 15.17.01

Creating Reports

Creating Reports

Salesforce Reports creation is very easy and we can reports in very less time. Login to your salesforce organization and click on reports tab you will navigate to below screen.
Salesforce Report
In the above image
– Report tab is used to navigate reports screen. when you click reports tab it will display above screen.
– Dashboard folder is used navigate list of dash board screen
– create new report folder is used to create new report folder
– Create new dashboard folder is used to create new dashboard folder
–  Left side box shows list of available report/dashboard folders in your org. By default salesforce will provide standard folders
– New report button is used to create new report and new dashboard button is used to create new dashboard.
To create new Salesforce Report follow below steps.
1. Click on report tab and then click in new report button. You will navigate to below screen
Report
2. Select the report type ( which type of report you are creating ) and click on Create button. You will navigate to below screen.
How to create reports in slaesforce
In the above image left side panel shows list of available fields in report type. We can easily add/remove fields to report by drag and drop from left side panel right (report preview) side panel. In salesforce we can create four types of reports. Those are Tabular, Summary, Matrix and Joined reports. We can add filters to our salesforce reports.
3. Click on Save your report once you done with your report customization(adding fields to report, selecting report format and adding filters to your report). Enter madatory fields to save the report, those are Report name and also select the report folder.

What is Dashboard?

What is Dashboard?
Dashboard is the graphical representation of the data generated by a report or multiple reports. Dashboard component types can be charts, tables, gauges, metrics, or other components that you can create with VisualForce.
You can add charts to your reports but dashboards give you more options and also the ability to add up to 20 charts and tables on one page for a quick view of multiple reports.
Below if an example of a dashboard. Here you can see each component (graph or table) is directly linked to a report. If you are interested the dashboard below was installed from the AppExchange and has a bunch of CRM Dashboards created by Salesforce, you can grab it here.

Screen Shot 2014-08-06 at 13.22.55

Reports

Reports

Reports

In any business reports are very important. Reports will provide clear picture to the management.
Management uses the reports to track progress towards its various goals, control expenditure and increase revenue. Reports help to predict trends and this is advantage of increasing profits.
In Salesforce.com we can easily generate reports in different style. And can create reports in very short time and also we schedule the reports. Salesforce provides a powerful suit of analytic tools to help you organize, view and analyze your data.
In Salesforce we can Create 4 types of report formats
1. Tabula Reports: Simple listing of data without any subtotals. This type of reports provide you most basically to look your data. Use tabular reports when you want a simple list or a list of items with a grand total.
Example: This type of reports are used to list all accounts, List of contacts, List of opportunities…..etc.….
2. Summary Reports: This type of reports provide a listing of data with groupings and sub totals. Use summary reports when you want subtotals based on the value of a particular field or when you want to create a hierarchically grouped report, such as sales organized by year and then by quarter.
Example: All opportunities for your team sub totaled by Sales Stage and Owner.
3. Matrix Reports: This type of reports allow you to group records both by row and by column. A comparison of related totals, with totals by both row and column. Use matrix reports when you want to see data by two different dimensions that aren’t related, such as date and product.
Example: Summarize opportunities by month vertically and by account horizontally.
4. Joined Reports: Blocks of related information in a single report. This type of reports enable you to adopt five different blocks to display different types of related data. Each block can own unique columns, summary fields, formulas, filters and sort order. Use joined reports to group and show data from multiple report types in different views.
Example: You can build a report to show opportunity, case and activity data for your accounts.

Creating approval process

Creating approval process

Salesforce approval process is an automated process and your organization can use to approve records in Salesforce, An approval process is combination of steps for a record to be approved and person has to approve it each step.A step can apply to all the records to that object or just record that meets the certain criteria. An approval process also specifies the actions to take when a record is approved, rejected, recalled, or first submitted for approval.
Simple or multi-step approval processes to automate and enforce the approval of virtually anything in your company.
  • Navigate setup -> Create -> Workflow & Approvals -> Approval Processes.
  • Select Object for the new approval process.
  • Click on  Create New Approval Process and choose Use Standard Setup Wizard from the drop-down button.
Note:  If you want to create a basic approval process with default settings. Click on Use Jump Start Wizard.

Salesforce approval process Example


Salesforce approval process
Salesforce approval process

1)     Enter name, Unique name and Description(Optional).
2)     Select criteria are met if you want to set a filter criteria that a record must meet to enter this approval process. For example, if only employees from headquarters should use this approval process to submit expense reports, enter the following filter criteria: “Current User: Office Location Equals Headquarters.”
Enter filter criteria for records that you want included in this approval process. Leave the filter blank if you want all records submitted to be included in the approval process.

Salesforce approval process
Salesforce approval process
Select formula evaluates to true if you want a formula to determine what records enter the approval process.

Salesforce approval process
Salesforce approval process

3)     When you define approval steps, you can assign approval requests to different users. One of your options is to use a user field to automatically route these requests. If you want to use this option for any of your approval steps, select a field from the pick list below. Also, when a record is in the approval process, it will always be locked– only an administrator will be able to edit it. However, you may choose to also allow the currently assigned approver to edit the record.
4)     Define initial submission actions
New field update / email / task -> Conditions -> save.
5)     Define approval steps
Manager step -> click on new approval step button -> provide the name -> all record should enter this step -> select approver manually and save.
  1. Manager step -> click on new approval step button -> provide the name -> all record should enter this step -> select approver manually and save.
  2. CEO step -> click on new approver step button -> provide the name -> enter criteria and save.
6)     Final approval steps
New field update / Task / Email according  to the field provide the condition and save .
7)     Final Rejection actions
New field -> provide the conditions and save.
  • Once the salesforce approval process is activated no more steps can be added.
Initial submission default actions cannot be edited but final approval & rejection default actions can be edited.

Creating Workflow Rules

Creating Workflow Rules

Workflow Rules are automated process to send E-mails alerts, assign tasks, update fields on trigger criteria based requirements.
To create a new rule:
  1. Select the object to which the workflow rule applies.

Workflow
Work Flow

  • Setup -> Create -> Workflow & Approvals -> Workflow Rules.
  • Click on New Rule on Workflow rules.
  • Select object which you want this workflow rule to apply.
    Workflow
    Workflow

2)   Clcik on ‘Next’.
  • Enter a rule name.
  • Enter a description for the rule.
  • Set the evaluation criteria

      Created

Evaluate the rule criteria each time a record is created. If the rule criteria is met, run the rule. Ignore all updates to existing records.With this option, the rule never runs more than once per record.

Created, and every time it’s edited

Evaluate the rule criteria each time a record is created or updated. If the rule criteria is met, run the rule.With this option, the rule repeatedly runs every time a record is edited, as long as the record meets the rule criteria.

Created, and any time it’s edited to subsequently meet criteria

Evaluate the rule criteria each time a record is created or updated.
  • For a new record, run the rule if the rule criteria is met.
  • For an updated record, run the rule only if the record is changed from not meeting the rule criteria to meeting the rule criteria.

Enter your rule criteria

Run this rule if the following according to the criteria based on requirements.
  • Criteria are met:  Select the filter criteria that a record must meet to trigger the rule.
  • Formula evaluates to true:      Enter a formula that returns a value of “True” or “False.” Salesforce triggers the rule if the formula returns “True.”
3) Click on Save& Next.

Workflow
Workflow

Possible workflow Actions for immediate workflow action:

 New Task to create a task to associate with the rule

Create a task to associate with one or more workflow rules, approval processes, or entitlement processes. When changing a task, any modifications will apply to all rules, approvals, or entitlement processes associated with it.

Workflow
Workflow

New Email to create an email alert to associate with the rule

Create an email alert to associate with one or more workflow rules, approval processes, or entitlement processes. When changing an email alert, any modifications will apply to all rules, approvals, or entitlement processes associated with it.

Workflow
Workflow

 New Field Update to define a field update to associate with the rule

Define the field update, including the object associated with the workflow rule, approval process, or entitlement process, the field to update, and the value to apply. Note that the field to update may be on a related object. Fields are shown only for the type that you select.

Workflow
Workflow

New Outbound Message to define an outbound message to associate with the rule

Enter the details of your outbound message and select the fields you want included in this message. Note that the fields available depend on the type of record previously selected.

Workflow
Workflow

Select Existing Action to select an existing action to associate with the rule


Workflow
Workflow

 For Time-Dependent Workflow Actions workflow action

     Click on Add Time Trigger

 Specify a number of days or hours before or after a date relevant to the record, such as the date the record was created or modified.
Click on Save.

Workflow
Workflow
4) Configure additional immediate or time-dependent actions.
5) Click Done and Activate the workflow.

What is search Layout?


What is search Layout?

When we search for a record in global search, by default it will display only standard record name field, when we click on look up icon it will display only standard record name field in look up by default. But I want to display more number of fields when i do global search & and also i want to display more number of fields in look up. To display more fields use search layouts.
By using search layouts, we can customize which Sobject fields display for users in search results, look up dialogs, and the lists on custom tab home pages. We can also specify a different set of fields to show in each search layout. The settings apply to all users in your organization. And also we can specify which buttons to display in custom list views.
How can we add fields to this layout?
for standard objects: here i am giving example for Account object.
Go to Setup -> Build -> Customize -> Account ->  click “Search Layout” you will navigate to below screen.
Search layout
Then click on which type of layout you want to modify & move the available fields to selected fields. See the below screen for reference.
Search Layout 2
We can add or remove fields by using add & remove button and also we change the order of fields by using up & down arrows shown in above image.
Some important points:
– We can add up to 10 fields in this layouts.
–  These layouts don’t apply to campaign members, opportunity teams & account teams.
– We can’t remove unique identifying fields like Account Name or Case Number, from the search layouts. These fields must be listed first in the order.
– We can‘t add long text fields such as Description, Solution Details, or custom long text area fields.
– Formula fields are not available in search result layouts.

Page layouts and Record Types


What is validation rules


sharing rules


what is Roles and role Hierarchy


OWDs

Organization wide default in salesforce.com


Organization Wide Defaults in Salesforce.com are the baseline record-level security for the objects in an org.  These settings define the foundational security that any user in a Salesforce.com Org will have.  It is the only place in Salesforce.com where an administrator can actually limit what data users can interact with. The organization wide default determines the distribution of data with the user. We use the defaults in the object to determine which people across the role hierarchy can access which objects.
The four primary permission settings for OWD in Salesforce.com:
Private – Records are only available to the owners of the records
Public Read – All users in the org can read all of the records for an object
Public Read/Write – All users in the org can read and write to all of the records for an object
Public Read/Write/Transfer – All users in the org can read/write and transfer ownership of records for an object

To set up organization-wide defaults follow the simple method:
  • First find out which user requires least access to an object. Set the organization-wide default to all the objects based on this user.
  • Most restrictive record access is defined using a organization-wide default. Access to additional records is made available through the role hierarchy, sharing rules, and manual sharing.
  • Changing organization-wide default settings can delete manual sharing if that sharing is no longer needed.
Limitations:
You can't change the organization-wide sharing default setting for some objects:
  • Solutions are always Public Read/Write.
  • Service contracts are always Private.
  • The ability to view or edit a document, report, or dashboard is based on a user's access to the folder in which it's stored.
  • Users can only view the forecasts of other users who are placed below them in the role hierarchy, unless forecast sharing is enabled. For more information, see Manually Sharing a Forecast.
  • When a custom object is on the detail side of a master-detail relationship with a standard object, its organization-wide default is set to Controlled by Parent and it is not editable.

Interview Questions : relationships

Interview Questions : relationships


 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 relationship 
 What 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 let’s 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.

Difference B/W lookup and master detail relationship


The key difference is master-detail has a direct dependency between the objects:

  • You cannot have a detail record without a master.
  • The detail record inherits sharing rules from the master.
  • You cannot update the relationship to the master in a master-detail relationship.
  • The number of master-detail relationships you can use are limited.
  • You cannot set profile object permissions for a detail record
  • Master-detail relationships are automatically included in report record types 

When you delete the master it will cascade delete all detail records relating to that master. A typical use of a Master-Detail would be the classic Sales Order and Sales Order Items objects. 

  • Lookups are generally for use where you may or may need to have a relationship between two objects (but not always).
  • Lookups are generally used to reference commonly shared data, such as reference data.
  • Lookups are used to link two objects together when you don't want the behaviour of the master-detail - particularly around sharing rules, profile permissions and cascade delete.
  • Lookups are used when you need to relate multiple 'parents' to the detail record.

You can change between a master-detail and a lookup after you create the field. My recommendation is always start with a Lookup relationship and then if you decide you need the features of a master-detail change it. If the detail object has it's own tab then you probably want to use a lookup not a master-detail.

Hierarchial / one-to-one relation

create a one-to-one relation between two objects:

  1. Create a lookup field on the child
  2. Create a unique field on the child, and hide this field from all page-layouts
  3. Write a workflow, for any change of the lookup field, to copy that value from the lookup field into the unique field

Many to Many relation / junction object


Create a Many-to-Many Relationship

Available in: both Salesforce Classic and Lightning Experience
Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions
Reports are not available in Database.com.


You can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa. For example, you may have a custom object called “Bug” that relates to the standard case object such that a bug could be related to multiple cases and a case could also be related to multiple bugs. When modeling a many-to-many relationship, you use a junction object to connect the two objects you want to relate to each other.
Junction Object
A custom object with two master-detail relationships. Using a custom junction object, you can model a “many-to-many” relationship between two objects. For example, you may have a custom object called “Bug” that relates to the standard case object such that a bug could be related to multiple cases and a case could also be related to multiple bugs.
Creating the many-to-many relationship consists of:
  1. Creating the junction object.
  2. Creating the two master-detail relationships.
  3. Customizing the related lists on the page layouts of the two master objects.
  4. Customizing reports to maximize the effectiveness of the many-to-many relationship.

Creating the Junction Object

  1. Create a custom object to be your junction object.
  2. In the custom object wizard, consider these tips specifically for junction objects:
    • Name the object with a label that indicates its purpose, such as BugCaseAssociation.
    • For the Record Name field, it is recommended that you use the auto-number data type.
    • Do not launch the custom tab wizard before clicking Save. Junction objects do not need a tab.

Creating the Two Master-Detail Relationships

To create the two master-detail relationships:
  1. Verify that the two objects you want to relate to each other already exist. For example, you may want to relate the standard case object to a custom bug object.
  2. On the junction object, create the first master-detail relationship field. In the custom field wizard:
    1. Choose Master-Detail Relationship as the field type.
    2. Select one of the objects to relate to your junction object. For example, select Case.
      The first master-detail relationship you create on your junction object becomes the primary relationship. This affects the following for the junction object records:
      • Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.
      • Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete both master-detail relationships on your junction object.
      • Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.
    3. Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines the sharing access that users must have to a master record to create, edit, or delete its associated detail records.
    4. For the Related List Label that will display on the page layout of the master object, do not accept the default. Change this to use the name of the other master object in your many-to-many relationship. For example, change this to Bugs so users will see a Bugs related list on the case detail page.
  3. On the junction object, create the second master-detail relationship. In the custom field wizard:
    1. Choose Master-Detail Relationship as the field type.
    2. Select the other desired master object to relate to your junction object. For example, select Bug.
      The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.
    3. Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines the sharing access that users must have to a master record to create, edit, or delete its associated detail records.
    4. For the Related List Label that will display on the page layout of the master object, do not accept the default. Change this to use the name of the other master object in your many-to-many relationship. For example, change this to Cases so users will see a Cases related list on the bug detail page.

Customizing Many-to-Many Relationship Related Lists

For a many-to-many relationship in Salesforce, each master object record displays a related list of the associated junction object records. To create a seamless user experience, you can change the name of the junction object related list on each of the master object page layouts to have the name of the other master object. For example, you might change the BugCaseAssociations related list to Cases on the bugs page layout and to Bugs on the cases page layout. You can further customize these related lists to display fields from the other master object.
To customize the fields that display in the junction object related list on each master object page layout:
  1. Edit the page layout of each master object that is related to the junction object. For example, modify the BugCaseAssociations related list for case records by editing the page layout for cases.
  2. Edit the properties of the related list you want to modify. For example, on cases the BugCaseAssociations related list was renamed to Bugs, so select the Bugs related list.
  3. Add the fields to display in the related list. You can add fields from the junction object itself, but more importantly, you can add fields from the other master object.
    Each field is prefixed with its object name in the popup window. In the related list itself, only fields from the junction object are prefixed with the object name; fields from the other master object are not.
Note :
The junction object related list does not include an icon on the master record's detail pages because the junction object does not have a custom tab. If you make a tab for the junction object, the icon is included.

Customizing Reports for Many-to-Many Relationships

Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report types are:
  • “Primary master with junction object and secondary master” in the primary master object's report category.
  • “Secondary master with junction object and primary master” in the secondary master object's report category.
The order of the master objects in the report type is important. The master object listed first determines the scope of records that can be displayed in the report.
You can create custom reports based on these standard report types. In addition, you can create custom report types to customize which related objects are joined in the report.

Look Up Relation

Look Up Relation:
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 the Salesforce online 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.

Master-detail relation

How to create Master Detail relationship in Salesforce?

I have two custom objects Member and Interest.


Note: From the child object create Master Detail field.

I want Interest Object to be the child of Member object, so that each member can have multiple interests.

To achieve this, follow the below steps

1.  Go to Interest object.

2. Go to Custom Fields & Relationships section.

3. Click "New" button.


4. Select "Master-Detail Relationship".

5. Click "Next" button.


6. Select Member object in "Related To" field.

7. Click "Next" button.



8.  Fill the required details.

9. Click "Next" button.


10. Since it is Master-Detail relationship, the field should be visible to all profiles.

11. Click "Next" button.


12. Click "Next" button.


13. Click "Save" button.


14. Go to objects and check whether Master Detail relationship has been implemented successfully.

Relationships in Salesforce

Relationships in Salesforce

Object Relationships in Salesforce
A 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.
  • The Owner field 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 the Owner field.
  • 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 can’t 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 the Allow reparenting option 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 the Salesforce online 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-Many
You can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.
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.