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
1answer
228 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 ...
11
votes
1answer
8k 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 ...
6
votes
1answer
1k 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 ...
2
votes
1answer
7k 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 ...
0
votes
1answer
49 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 ...
0
votes
0answers
110 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 ...
0
votes
1answer
88 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 ...
16
votes
2answers
3k 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 ...
9
votes
1answer
16k 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 ...
7
votes
1answer
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 ... /...
2
votes
2answers
560 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 ...
11
votes
2answers
8k 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 ...
7
votes
2answers
17k 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 ...
5
votes
1answer
341 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?
2
votes
0answers
188 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 ...
8
votes
3answers
6k 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 ...
4
votes
2answers
5k 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 ...
4
votes
1answer
1k 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 ...
3
votes
1answer
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 ...
2
votes
2answers
1k 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
2
votes
1answer
4k 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 ...
1
vote
1answer
459 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 ...
1
vote
2answers
2k 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 ...
0
votes
0answers
17 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 ...
0
votes
2answers
737 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 ...