Skip to main content

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
4 votes
1 answer
12k views

Relationship between Account and Opportunity and Account and Contact

On Opportunity there is a lookup relationship to Account.But why it behaves as Master-Detail as we can create Rollup Summary Fields on Account. Similarly if we delete Account then Contact gets ...
sfdc's user avatar
  • 13.7k
4 votes
2 answers
508 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
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
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
2 votes
1 answer
3k views

Toggling "Allow Reparenting" on Master Detail record

I have a master detail relationship that does not currently allow re-parenting. I also have some detail records that were created on the wrong parent. Will I be causing any problems in my instance ...
Jagular's user avatar
  • 3,376
0 votes
1 answer
95 views

How can I change this method to query my master detail object?

I am new to Apex trying to do some practice assignments and have gotten stuck on this junction object query. Task: Edit the current getUser() method to do the following: Return a custom object (that ...
Patrick Shea's user avatar
0 votes
1 answer
320 views

Need help on trigger which is used to update parent record when child record value changes

Hi i have written trigger in which SC_Problem_Management__c is parent object and SC_Problem_Case_Link__c is child object having master detail relationship. I want to update status field of parent ...
Snehal's user avatar
  • 35
0 votes
0 answers
139 views

How to upsert child object with master details realationship to another customobject,which one master as opportunity

I have one custom object(named: Class__c),it has master another custom object (Plan__c). Further this Plan has Standard object Opportunity as master. I have Class.csv files which contains classes ...
David Mycka's user avatar
  • 1,357
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
16k 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
9 votes
2 answers
29k 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
  • 397
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
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,781
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.5k
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
1 answer
746 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
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
3 votes
1 answer
2k views

How to obtain "Related Content" information in SOQL/APEX

EDIT: There were two questions earlier. I figured one out. Please see below We can have Attachment objects on custom object records but can we for example, associate a Salesforce File or Content ...
Salesforce_newbie's user avatar
3 votes
2 answers
2k views

Can I feel safe to change a lookup relationship field into master-detail relationship if it is required and cascade deletion

In my scenario, I really want to have a roll-up summary in my master object so I can know which ones doesn't have child objects. Currently it is a lookup relationship which is required and will be ...
Lance Shi's user avatar
  • 13k
2 votes
0 answers
194 views

Parent Lkp Id empty when custom New page is used in Salesforce1. Why?

I have a master detail Child__c object with a custom page override for New and Edit. This page is used in desktop and mobile Salesforce1 context. My problem: the page doesn't work in Salesforce1 as ...
Robert Sösemann's user avatar
2 votes
1 answer
5k views

Can I add a custom message at the top of a page based on some criteria?

Our tech support team uses cases for interacting with customers. Based on some criteria on the parent account, we are looking for a way to show a message to our tech support team indicating that this ...
Justin Helgerson's user avatar
2 votes
2 answers
4k views

How to handle Roll Up Summary type Calculations WITHOUT using Master-Detail

I currently have an object called Opportunities__c with a child object related to it, Opportunities_Forecast__c via a Master-Detail relationship. The Forecast__c object contains two number fields that ...
Dan Jones's user avatar
  • 7,237
2 votes
1 answer
823 views

Update siblings and parent record in the same after update trigger

I have written a code to update all the sibling's and parent contact's field when one of the child records have been updated. The logic here is to make checkbox false on all the siblings and parent ...
anxiousAvocado's user avatar
2 votes
1 answer
404 views

Why am I getting an error about recursive update in my trigger when I add a rollup summary field?

I have a trigger on a parent object that manages master detail child records. This trigger needs to check a given flag field on the parent record to determine whether it needs to process the child ...
Phil W's user avatar
  • 37.5k
2 votes
2 answers
747 views

Salesforce1: How to reference the Parent Id on "new" action?

I have a mobile app with two Objects which are linked via Master-Detail. I have overwritten the new page for creating an child record with an custom visualforce page. This page should create an ...
Robert Méndez's user avatar
2 votes
2 answers
2k views

Master-Detail Relationship on Custom Object from Managed Package

Is it possible to add Master-Detail Relationship on Managed Custom Object? currently I am getting below error
Mehul's user avatar
  • 449
1 vote
1 answer
280 views

Chrome "Aw, Snap! error code: STATUS_BREAKPOINT" occurring in 3 different scenarios

I get the following error in Chrome: "Aw, Snap! error code: STATUS_BREAKPOINT" in two different actions (and found a third, "workbench.developerforce.com object list drop-down is ...
Andrew Mackler's user avatar
1 vote
3 answers
14k views

What is the maximum number of lookup relationships an object can have?

What is the maximum number of lookup relationships an object can have?
Darshana's user avatar
0 votes
0 answers
158 views

How to create roll-up summary field on Master Object to display Status of most recent line item?

The relationship between the objects is Master-Detail. Object1 - Ticket | Object2 - Tasks. I'd like to display Status of most recent Task (line item) record on Ticket Object. How can I achieve this? ...
Marci K. 's user avatar
0 votes
0 answers
20 views

How can I return a Custom Object with a List of Parent Data from querying the Junction Object? [duplicate]

I am new to Apex trying to do some practice assignments and have gotten stuck on this junction object query. Task: Edit the current getUser() method to do the following: Return a custom object (that ...
Patrick Shea's user avatar
0 votes
2 answers
923 views

Rollup Opportunity fields on Custom object

I have custom object that is between Account and Opportunity. I need it to roll up some of the field from the opportunity, but I can't because the opportunity cannot have another master, and rollups ...
denvergreene's user avatar
  • 1,196