Questions tagged [master-detail]

This type of relationship closely links objects together such that the master record controls certain behaviors of the detail and subdetail record.

Filter by
Sorted by
Tagged with
18 votes
2 answers
4k views

Delete triggers don't cascade master to detail, so why not hand-cascade on the master?

I understand from experience that Master-Detail deletion triggers do not cascade. For example if I delete my Account the Contact deletion triggers don't fire. Having devoured the first and second ...
Matt and Neil's user avatar
15 votes
2 answers
15k views

Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field

I am trying to deploy an update to a custom object. The object and classes associated with it work perfectly in my sandbox, but when I try to deploy, I get the following error: Cannot set ...
hgolov's user avatar
  • 773
13 votes
1 answer
12k views

Why can't I create a master-detail relationship between Product and my custom object?

Trying to create a master-detail relationship between my custom object (detail) and the standard product object (master). Initially it said I couldn't create this because I needed to make sure all ...
Adam 's user avatar
  • 1,426
13 votes
3 answers
9k views

Can you convert a Master-Detail relationship to a Lookup if it's referenced in code?

I've got a Master-Detail relationship on a custom object where the parent is the Account object. There are no roll-up summary fields on the Account object, and there are no formula fields on the ...
Matt Lacey's user avatar
  • 25.6k
11 votes
1 answer
1k views

Obtaining Single Record - SOQL vs. Instantiating New Object

Background I have a custom object which has a master/detail relationship to Opportunities. Whenever a record on this custom object is created or edited, I need to update the parent opportunity (and ...
Optimus's user avatar
  • 331
9 votes
1 answer
18k views

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] on opportunity

I have created an object named as "Component" which has Master-Detail Relationship with Opportunity Object. On Opportunity we have a button says "Create Component", when user clicks on it it takes ...
Pramod Kumar's user avatar
  • 5,300
8 votes
2 answers
27k views

Is it possible to convert a Master-Detail relationship to a Lookup?

I'm going through the Trailhead training (here), and see the following two snippets which seem to disagree: "It’s possible to change a lookup relationship to a master-detail relationship, but not ...
loneboat's user avatar
  • 387
8 votes
3 answers
7k views

Master-Detail Relationship Limit

Salesforce says "As a best practice, don't exceed 10,000 child records for a master-detail relationship." here : http://na1.salesforce.com/help/doc/en/relationships_considerations.htm What does "for ...
LVS's user avatar
  • 1,741
8 votes
2 answers
8k views

Cannot set sharingModel to ReadWrite on a CustomObject with a MasterDetail relationship field

Has anybody bumped into this error when spinning a new scratch org? Here's how this happened. I created a new scratch org and created 2 objects. One had a lookup field to the other. Then I pulled ...
Arthlete's user avatar
  • 4,907
7 votes
1 answer
2k views

Does Lookup Skew affect only master-detail relationships or also lookup ones?

I've been encountering and reading a lot about data skew issues, particularly lookup skew, and I've noticed that most information I've found doesn't explicitly indicate whether this affects master-...
jonathanwiesel's user avatar
7 votes
1 answer
6k views

Why can't Leads or Users be Masters in a Master-Detail relationship

I ask this both out of curiosity, and if I wanted to create an object that I wanted to act as a child to one of those objects I would have a better idea how I could do that. Let's say for example ...
davea0511's user avatar
  • 355
7 votes
3 answers
4k views

Upsert Detail object without external Id

I have two related objects (Master-Detail) A -> B (where B is child of A). In addition there is only one B for a parent A. I need to upsert the B object and I only have the A.Id and other fields of ...
Martin Borthiry's user avatar
6 votes
1 answer
8k views

What are the implications of using a reparentable master-detail relationship instead of a lookup?

Since the Summer 12 release of salesforce it's been possible to set the "Allow reparenting" attribute on master-detail fields. This somewhat blurs the traditionally clear line of when to use a master-...
ca_peterson's user avatar
6 votes
1 answer
3k views

"Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail" on an "sfdx force:source:push"

Been getting the error: Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail this morning when editing/adding fields to some custom objects that are in a master-...
Keith C's user avatar
  • 136k
6 votes
2 answers
3k views

SOQL Outer Join Multi Level Master Detail Relationship

I am working with a 3 Level Master Detail Object Relationship: "Level 1" has "Level 2" detail records "Level 2" has "Level 3" detail records I am trying to Query "Level 1 records" and using an ...
Justin J Carlson's user avatar
6 votes
2 answers
2k views

Master Detail Relationship

I have master-detail relationship between A-B object. A is master and B is child . Now the requirement is , that A must be public and B must be private. what's the best way to implement this.
amidstCloud's user avatar
  • 2,827
6 votes
6 answers
37k views

How many master-detail relationships per object?

All I see online is that each object can have 2 master-detail relationships, but on the Salesforce App Limits PDF : https://na5.salesforce.com/help/pdfs/en/salesforce_app_limits_cheatsheet.pdf It ...
newuser's user avatar
  • 159
6 votes
2 answers
5k views

profile object permissions for a detail record

When readng through trailhead salesforce I came across a line which I am unable to digest. The line says - "You can’t set profile object permissions for a detail record". What does this mean? In my ...
SfdcBat's user avatar
  • 4,791
6 votes
2 answers
4k views

Custom Related List with Custom Object

I am quite new to Salesforce and have not yet any thing like the following. We have a Paper object which is looking up for authors in Contact object. We want to create to have custom related list of ...
vlr's user avatar
  • 864
6 votes
1 answer
1k views

Do Master Records (in a Master-detail Relationship) Get Locked?

Suppose the following: There's a master-detail relationship between two custom objects There are no roll-up summary fields on the master object There are no declarative automations or Apex triggers ...
M H's user avatar
  • 779
6 votes
1 answer
2k views

Soql query on parents other child object

I want to write a soql query , My scenario is as follows. I have three objects objectA,objectB,objectC. objectA is the parent object for both objectB,objectC. objectA - objectB (Master-detail ...
Salesforce developer's user avatar
6 votes
1 answer
748 views

What happens to Master-Detail after deleting (Managed Package)

When I delete a Master-Detail relationship in my managed Package Will it be replaced by a Lookup, like this Knowledge arcticle says? Will there still be a Master-Detail relationship in our customers ...
itsmebasti's user avatar
  • 6,437
5 votes
2 answers
1k views

Convert SQL query into SOQL query

I've been trying to figure out how to turn this SQL query into a SOQL query. Every time I think I am getting better with SOQL something comes along and erases that thought. Account is the parent ...
twiggler's user avatar
  • 103
5 votes
3 answers
6k views

How do you use an external ID in the import wizard to import child objects of a master/detail relationship?

OK, I need to import a few thousand records and import wizard seemed like a good choice. First I did some accounts - that went smoothly. Next I went to import some custom objects that have a master/...
Ryan Elkins's user avatar
  • 7,677
5 votes
2 answers
5k views

How to report on a master-detail relationship

I have a custom object named Milestones (with a field named MilestoneType) that has a Master-Detail relationship to Contact. I want to build a report where I can pull all contacts that have a ...
fourq's user avatar
  • 2,111
5 votes
1 answer
9k views

Visibility of records in a junction object - AND based or relationshipOrder based?

I have a question about junction object record visibility. I will start with a snippet from an SFDC document: https://help.salesforce.com/apex/HTViewHelpDoc?id=relationships_considerations.htm&...
Andy Forbes's user avatar
5 votes
1 answer
724 views

When using FOR UPDATE does Salesforce also lock the child records in a master-detail relationship?

For example, say I get a List of rows to delete using FOR UPDATE. These are all parent records in a master-detail relationship. Will the children be locked?
Bradley Thomas's user avatar
5 votes
1 answer
2k views

Update custom Lightning Component on Master when Detail "Related List" Component edited

I have a custom Lightning Component on an Opportunity Record FlexiPage, that shows a Master-Detail relationship Rollup Calculation (e.g. the count of detail records). After adding an item via the "...
shannon's user avatar
  • 337
5 votes
1 answer
2k views

How to implement Lookups in Lightning Components?

Assume you have a Lookup or Master-Detail relationship defined in the metadata and now you need a simple UI. In Visualforce lookup-controls on the UI run out-of-the-box using <apex:inputField ... /...
Uwe Heim's user avatar
  • 28.4k
5 votes
1 answer
1k views

Child Record delete invoking Parent trigger

I have written a trigger on Parent__c Object (after insert,after update-This trigger creates a child__c record depending on few conditions). But when i am deleting child__c record, it invokes this ...
snehakem's user avatar
  • 2,279
5 votes
1 answer
1k views

Does adding a detail record cause an update event on the master record?

Background I have a master-detail relationship between two objects, let's call them: parent__c child__c Once the parent__c record is in a certain status__c we block any changes using a before ...
Robs's user avatar
  • 9,336
5 votes
1 answer
2k views

How to refer to an existing record in REST API composite JSON?

When using REST API composite JSON, how to refer with external id an existing record to existing Master-Detail parent from a newly created child We have the following objects: Organization__c: Has ...
Touko's user avatar
  • 151
5 votes
2 answers
237 views

How to denormalise a Master-Detail relationship

Contacts have Specialities (skills) to sell so I have a Master-Detail from Contact to Speciality. We sell Product (1/2 day, full day) for those Contacts so the Product has a lookup to the Contact. ...
Greg Shaw's user avatar
  • 357
4 votes
2 answers
4k views

Illegal assignment from sObject to Id

I'm trying to insert two master-detail lists at the same time. I'm looking through Bob Buzzard's blog post: http://bobbuzzard.blogspot.com/2012/03/create-parent-and-child-records-in-one.html Where he ...
Dan Wooding's user avatar
  • 3,538
4 votes
1 answer
1k views

Can Detail Objects trigger Master Object Workflows?

I want changes to detail objects to trigger a workflow on the master object. The master object has a rollup summary field which COUNTs how many detail objects have a certain field set. When I change ...
Marc's user avatar
  • 1,705
4 votes
2 answers
486 views

Reading and writing child relationships of not-yet persisted SObjects?

I have a Parent__c and Child__c custom object connected by a lkp_Parent__c field. I now create an in-memory version (no insert) of a parent-child tree Parent__c p = new Parent__c(); Child__c c = new ...
Robert Sösemann's user avatar
4 votes
2 answers
2k views

100.000 children in Master Detail relationship? What's the downside? [duplicate]

I know that Salesforce is recommending to keep the number of child records in Master-Detail relationships (MDR) below 10.000 records. In one situation I am heavily relying on Sharing being inherited ...
Robert Sösemann's user avatar
4 votes
1 answer
2k views

Any reason not to use Lookups instead of Master-Details for Junction object?

To build n-m relationships one needs a Linker/Junction object with two references. The Salesforce documentation recommends two Master-Detail relationships. Is there any reason why not to use two ...
Robert Sösemann's user avatar
4 votes
3 answers
5k views

Look Up relation Vs Master detail relation

I have small doubt in choosing between look up field and master detail field. I have a custom object say cObj1 which should always be related to some other object say cObj2. So I can opt for ...
Monalisa Das's user avatar
4 votes
2 answers
7k views

Can I Update a Child Record when the Parent Changes with Workflows?

I have two objects in a parent-child relationship: job order (parent) and application (child.) I'm attempting to use workflow rules to update the status of certain applications when the job order is ...
Austin Zentz's user avatar
4 votes
1 answer
3k views

Deleting Custom Objects

I have three connected Custom Object I'm trying to delete. When I attempt to delete them, I get the following message. 'Your attempt to delete .... could not be completed because it is associated ...
James Powell's user avatar
4 votes
1 answer
9k views

Inner SOQL child to parent query

I have written the below parent to child inner query which works : List<master__c> masterObj = new List<master__c>([Select id, (Select ID FROM detail__r) FROM Master__c]); Which ...
xyz sfdc's user avatar
4 votes
2 answers
7k views

"maximum depth of master-detail relationship exceeded" Can't change from Look up To Master Detail

I have two Object, Current Relationship is Look Up I am trying change it to M-D. In change Field Type the field itself is "Grayed Out" with this Info. My Intial requirement was Master-Detail because ...
user40138's user avatar
  • 948
4 votes
1 answer
1k views

Using Global Actions to Create a child record - MD relationship

Is it possible to use Global Actions in Salesforce to create a Child Record in a Master-Detail Relationship? I only see the master in the list of Target Objects.
user43124's user avatar
4 votes
2 answers
468 views

External SalesForce Forms

Is it possible to create external SalesForce Forms that can populate fields in the same way as inside salesforce? We offer online teaching and the idea is that teachers, after every lesson, can fill ...
user3808606's user avatar
4 votes
2 answers
2k views

Is it possible to query the lookup object fields of child object?How to do it?

We have a parent object say ParentA with its associated child object as ChildA with a custom field customerName of type lookup(Account). Now I would like to retrieve AccountNumber, which is field on ...
Priyalakshmi's user avatar
  • 1,456
4 votes
1 answer
1k views

How do I deprecate/delete a master object part of a junction object which is part of a managed package?

Here is the scenario: As part of a managed package, we have 3 objects. Object A & Object C are Masters and Object B is the junction object between A & C. We packaged it all up and all good up ...
diablodeveloper's user avatar
4 votes
1 answer
9k views

Querying a Master Detail Relationship

I am currently learning Salesforce and Apex etc and I am stuck trying to write a trigger which contains a query. Here are my two custom objects: Student__c (Object) Nickname__c Email__c ...
user8737's user avatar
  • 823
4 votes
1 answer
917 views

How to decide whether to use Text or AutoNumber for the detail object in master-detail relationship?

I am trying to decide whether to use Text or AutoNumber for the detail object in master-detail relationship. What are the considerations that may affect this decision?
Mingyu's user avatar
  • 479
4 votes
2 answers
6k views

query to get child object data

I'm pretty new to SalesForce and my question should be very simple. I'm creating an extension for a standard controller of a custom object called Bill_Account_c. This object has a master detail field ...
tony danza's user avatar

1
2 3 4 5
9