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
0
votes
1answer
22 views

update all child record when parent record is updated

I have created trigger on parent object (Vendor__c) to update child records(Transaction__c). Logic : when the Vendor Manager field is updated on a Vendor record, look for Transaction records ...
1
vote
1answer
23 views

Master-Detail Relationship causing problems with creating Related Records

We have a custom object to log our Activities with Customers. Until very recently, it had a lookup to that account. To better serve our reporting needs, I changed that lookup to a master-detail. Now, ...
0
votes
1answer
16 views

I can't convert my Master-Detail field to a Lookup field because the Change Field Type button is not visible

I have deleted all Roll-up Summary fields in the Master object including those in the Deleted Fields but the Change Field Type button is still not showing. Do you have any idea what I can do?
2
votes
1answer
37 views

Working round the lack of formula fields of type “Lookup Relationship”

When you have a master-detail chain of objects several levels deep, sometimes a lookup field to the root object on each child object is helpful for easy navigation or to show deeper records than the ...
1
vote
2answers
50 views

trigger to update field on parent object based on field in child record

so i have 2 custom objects, rep and role history. rep is the master and role history is the detail. rep has a field "rep type" that needs to be systematically updated to reflect whatever is in the "...
0
votes
0answers
31 views

Error on inserting Child record of Master Detail Relationship

Error on inserting Child record on custom object which is having Master Detail relationship with other Custom Object. I have two custom Objects x and Y which are in Master Details Relations. There ...
1
vote
0answers
97 views

How to use the wire service to get field from child Object? [duplicate]

This seems to be pretty simple but I kinda lost right now. I want to create a LWC based on two custom objects which has a master-detail relationship. I have a 'master' object Product__c Name Id etc ...
0
votes
1answer
18 views

How to Access field from Detail object in Master object?

I have a customer object as master and Document object as Detail which has a Status__c field. Since its a Master-Detail there can be multiple Documents to the custom object. I want to maintain a ...
1
vote
1answer
35 views

Sharing Setting on MAster Detail Field is not being enforced - Bug or correct SF behaviour

There are two Objects 'Parent' and 'Child'. Two User Admin and LocalUser. As per the profile of LocalUser : Parent Object has Read permission Child Object Has CRU permission OWD for Parent Object is ...
2
votes
1answer
53 views

Apex Test Class: Populate parent relationship in a Master-Detail

I have the following code in a test class parent__c parent = new parent__c(); insert parent; child__c child = new child__c(); child.parent__c = parent.Id; insert child; In the DataBase, the ...
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
1answer
42 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 ...
2
votes
0answers
83 views

LWC: Master-detail field default value in Lightning-record-form

Is there a way to assign default value for record's master-detail field on LWC component "lightning-record-form" ?
0
votes
1answer
35 views

Update a master-detail lookup using a before trigger and the name of the parent record which is a concatenation of fields on the child record?

I have two objects - Customer Visit Quota and Contact Report. The contact report object has a "Number of Visits Field" that should roll up on the Customer Visit Quota. I have a master detail look up ...
1
vote
1answer
104 views

How can I link two records in a flow?

I'm creating a flow that creates two records on two separate objects. The objects are linked in a master-details relationship. But I cannot figure out how to create the relationship between the two ...
0
votes
2answers
100 views

How to set multiple objects as parents for a custom object

I have requirement where a custom objects needs to have multiple objects as its parents. For example a custom object must have master-detail relationships with Account, Opportunity, Case etc. We can ...
0
votes
0answers
64 views

How master-detail records are synchronized/accessible in junction object?

I have a Juction object CaseJiraItemAssociation__c which is have two master-detail relationship (on Case__c and JiraItem__c custom objects) and I have one outbound message (end point) on JiraItem__c ...
2
votes
1answer
41 views

How to update child in Master-Detail relationship with REST API?

I have a Master-Detail relationship with Accounts and Locations. I am able to create the child using upsert, but when I try to update the Account__c field I get (INVALID_FIELD_FOR_INSERT_UPDATE: ...
2
votes
2answers
193 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 ...
0
votes
2answers
80 views

How to update parent field with child field value FOR EXISTING records

There are two Objects with master-detail relationship (Contact and Certification__c) I need to copy a textfield(Name) value from the child object(Certification__c) and paste it on it's Parent's(...
3
votes
1answer
61 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 ...
1
vote
0answers
119 views

Process builder update other child records except himself

I have a process builder, which is triggered by a child object, Asset. As an action I want it to update other child records for the same parent Account. But it should update all related Asset records ...
0
votes
1answer
70 views

parent to child record changes using trigger [duplicate]

I have trigger on parent object which is used to update field Status of child object, I want to update child object's status field to Tested only if previous values is "ready for testing". And once ...
0
votes
1answer
58 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 ...
0
votes
2answers
525 views

If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name

I'm having trouble putting together a SOQL query. Basically i have a parent object (Opportunity), with multiple child objects (Borrower_Pair__c). The relationship from the child to parent is created ...
0
votes
1answer
38 views

How do i access child fields.Below is the code

trigger ProcdureTrigger on Test1105__Procedure__c (before update) { public map<Test1105__Procedure__c,List<Test1105__Procedure_product__c>> accountContactMap = new map<...
0
votes
1answer
24 views

How does joining two custom objects into one custom object through master-detail relationship work

I've been working on a test method but I've had a problem creating the setup of it. public static List<Job_Posting__c> createPostings(){ List<Job_Posting__c> testPostings = new ...
0
votes
2answers
71 views

ChildId not available when passing Set Flow Variable from Process Builder to FLOW

BACKGROUND I have two objects in a master-detail relationship. One is Parent, the other is Child. I have a Process Builder Flow that starts when a Parent record is created or edited. I have criteria ...
0
votes
2answers
98 views

Trying to insert to 2 different custom objects which is in a master-detail relationship

I am trying to use the DML statement to make an insert to the parent and child tables all at once. I have got it to this point so far, I am not sure how to link the child to the parent when doing the ...
0
votes
1answer
111 views

How to establish One to Many relationship using Apex

I am building an app which reads information from an external API and then populates data in my App for further processing. I have two kinds of custom objects for this. First kind (e.g., Profile) ...
1
vote
1answer
48 views

What objects cannot be masters in master detail relationships?

I have the following objects Training_Group_Criteria__c and Training_Group_Rule__c. I am trying to create a master-detail field to make Training_Group_Rule__c a detail of Training_Group_Criteria__c. ...
0
votes
2answers
23 views

Partial deletion in master detail relationship

In a master-detail relationship, if I am deleting the parent record,lets assume half of its child records were deleted after which I was getting some exception and the remaining child records were not ...
2
votes
3answers
322 views

Converting lookup relationship into master detail relationship

I had converted lookup relationship into master detail for a child object which contains lakhs of records. So when a parent record is deleted, all these child records has to be deleted automatically ...
5
votes
1answer
201 views

Is it still not possible to get the Related List Label of Lookup fields via APEX?

We wrote a custom deduplication and merge tool allowing us to overcome the Salesforce limitation only to get the deduplication UI only for a few objects. Our tool needs to work on ANY SObject (custom +...
0
votes
1answer
200 views

Count the number of details in master-detail relationship

How can I count the number of details in master-detail relationship? Let us suppose I have Detail_Type__c and Master_Type__c. Now if I have and Id of a Master_Type__c record I can do the following ...
0
votes
1answer
95 views

Opportunity and Account Relationships

We know that deleting the Account deletes the related opportunities(considering Master details relationships). However, if I delete an opportunity related to Account, will it cause the update of its ...
1
vote
1answer
140 views

Master-Detail relationship questions

I have 2 questions when it comes to master detail. We all know the detail object inherits its sharing from the master. But what about CRUD and FLS? My guess is that those are still separate but I am ...
0
votes
3answers
2k views

The number of Lookup relationship that an object can have are as in today?

The number of Lookup relationship that an object can have are as in today ?
0
votes
1answer
46 views

What is the best way to query a lookup on a Master object in Apex?

I am trying to create a Trigger on an object 'Education History' and the trigger is supposed to check if an 'Affiliation' record already exists based on comparing two fields and update that ...
1
vote
0answers
61 views

Auto populate Account name on child object while click on “Save & New” standard button

I have created a custom object and created a Master-details lookup field to Account. While creating new records, there is an issue. When I click on New button, fill in all the fields and click on "...
1
vote
2answers
30 views

Calculating grand total of child object's field

public static List <Pricing_Lookup__c> getGrandTotal(){ List<Pricing_Lookup__c> calculateTotal = [Select Name, (Select Name, Unit_Price__c From Activity_Lookup__r) From ...
0
votes
1answer
90 views

Need help writing query for 3 custom objects in master detail relationship

I'm trying to create a table on Visualforce page like this. Each pricelookup's description has it's own activity and purchase info. Custom parent object - Pricing_Lookup__c Custom child object - ...
1
vote
1answer
56 views

Unable to pass Master-detail id while creating multiple records using ng-repeat

I have a use case where I have to display some fields on visualforce page and then whatever data user provides on the page, grab the data and create a record out if it. Now the record needs to be ...
0
votes
1answer
691 views

Child record's record type based on Parent record's record type [closed]

Objects: Account, Opportunity Record Types: Account --> A, B Record Types: Opportunity --> a, b When creating an Opportunity I'm trying to setup an opportunity record type/page layout that will ...
3
votes
1answer
569 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 ...
7
votes
2answers
1k 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 ...
0
votes
2answers
553 views

Data Loading into Master Detail relationship objects

I have a scnario which I am not able to get through. I have two objects, Obj A and Obj B, both related through Master-Detail relation with Obj A being Master. Now, I have some records to be inserted ...
0
votes
1answer
687 views

Does Salesforce Shield Field Audit trail allow field history tracking on detail objects in master details [closed]

Need to know about field audit trail, Salesforce shield.
-2
votes
1answer
24 views

Why I am not getting values in my page?

below is my class, Can you help where i am going wrong, I am not getting values in my page public class DeleteFlag { public Property__c prop{get; set;} Public Unit__c unts{get;set;} public List<...
0
votes
0answers
183 views

Can we get prior value of Parent record in process builder with child as the object?

I have a list of salesforce task copied as records in an object called AdmissionSteps. I have another object called Student. I have created a process builder with AdmissionSteps as the object. In ...