Questions tagged [childrelationship]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Is there a work around for Creating multiple Parent and Child Records in a Single Statement Using Foreign Keys for the same SObject?

Im working on inserting multiple campaign records with a self-relationship. I was hoping to do this with one DML statement using the method described here: Link I know in the first paragraph it says ...
-1 votes
1 answer
57 views

update child records from flow multiple times

Anyone has had the requirement of updating same child records from a flow multiple times, pertaining to multiple decisions, which may or may not be mutually exclusive? Ideally I would wish to assign ...
0 votes
1 answer
2k views

How to update the fields in Case object once sent the email from email message

I have working to convert the workflow into flow. But am stuck with connecting the parent and child objects which was email and case on while creating the flow. Am not aware how to connect these two ...
4 votes
2 answers
5k views

How can I check that parent has more than 1 child?

Now I'm trying to use this to check it: List<Tool__c> tools = [ SELECT Id FROM Tool__c WHERE Date__c >= 2019-09-11T00:00:00.000Z ]; for (Tool__c t : tools) { //And I'll get here 101 ...
0 votes
1 answer
35 views

How do I write a soql child query using the new partner object

I need to pull from a custom object and where account (look up field) where partner (child object) role = x Original query: select id, account from customobject My thought for the partner: select id, ...
0 votes
2 answers
7k views

Can we use formula fields in lookup filters or how do I implement lookup filter to match `D.A` to be equal to `C.B.A`?

I am trying to introduce a lookup filter. I have standard object A, standard object D which has lookup to A and custom object B__c which has lookup to A and custom object C__c which has lookup to ...
-1 votes
1 answer
74 views

Salesforce SOQL Query Error on custom relationship

I plugged in the query below: SELECT Id, UserId,User.Name,Account.Name,TeamMemberRole,LastModifiedDate FROM AccountTeamMember WHERE TeamMemberRole = 'Customer Success Manager' AND Account.CSM__r.Name !...
0 votes
0 answers
966 views

Get the sum of a currency field of all related Opportunity childs and grandchilds using a flow

I just started my flow journey and I can't find a solution to my problem. I have two different opportunity types. In type A I want to display the sum of the Amount field of all the subordinate records ...
0 votes
0 answers
1k views

Updating Account owner based on Territory2 and Account relationship

This is my Pseudocode Trigger on Territory2 before Update If IsChanged (UserTerritory2Association.User) Get AccountID of the Account assigned to the Territory from ObjectTerritory2Association Get ...
0 votes
1 answer
107 views

Parent-Child relationship query

Given Account - MaintenancePlan relationship, I have this SOQL: SELECT Id, (SELECT id from MaintenancePlans WHERE Id = 'xxxxxxxxpUGAS') FROM Account Problem is that I just need to get the ...
1 vote
0 answers
311 views

How to display child records in separate tables on Visualforce page for PDF

Hope we're all hanging in there. I'm relatively new to vf (please bear with me). I'm attempting to create a PDF via visualforce from a custom object (Deal_Summary__c) and its 5 related objects (4 are ...
1 vote
0 answers
36 views

Lifecycle hook for child component?

I understand lifecycle hooks for a custom LWC. But how do I detect when a child LWC has loaded in the DOM? For example, let's say I have a <lightning-datatable> that is a child of a custom LWC I'...
6 votes
0 answers
274 views

APEX Schema ChildRelationships: why have some relationships their relationshipName = null?

There is some strangeness in the some standard Childrelationships. Most Relationships are as expected, but let us take Account and Quote as an example: On Quote we have a standard lookup field Quote....
0 votes
1 answer
420 views

Child relationship name missing

When I look at some of the Salesforce built-in objects, I notice some lookup field do not have a child relationship name defined - and I cannot set them myself. For example if I look at the "...
1 vote
2 answers
1k views

SOQL with standard objects relationship query help

I need to combine these 2 queries so that I get the Case Members and Case details in one result. There are no custom fields/objects. Both queries run independently but when I try the subquery/...
0 votes
0 answers
582 views

How to query formula field and related object field values by Schema class

I have this below method when I am passing fields dynamically to get passed object records. relatedObjectName ==> Planner__c recId ==> RecordId of Planner__c fields = AccountPlanner__r.Email (...
2 votes
1 answer
215 views

How do I get a label of Parent to Child relationship?

I am trying to get a label of Parent to Child relationship? for (ChildRelationship child: Quote.sObjectType.getDescribe().getChildRelationships()) { System.debug(child.getRelationshipName()); } ...
0 votes
1 answer
1k views

Delete permission on child object of Master Detail relationship

I need to give delete permission for one object. That object has Master-detail relationship with Account, and that profile has View all Permission for an Account object. The profile has Delete and ...
-2 votes
3 answers
441 views

how to know which all child objects has relationship with opportunity in salesforce. (Opportunity is parent)

I need to know which all objects have parent as Opportunity. Is there any easy way to get the details?
1 vote
1 answer
517 views

Field update on parent object based on child criteria [closed]

I have a custom child object called Job on Account. They are in lookup relationship. The field on Account is HasOpenJob, I want that to automatically change to True, in case any of its Job's Stage ...
3 votes
4 answers
2k views

Sub-Querying Objects, Plural Relationship Name?

This may be pretty basic I've come across something in SOQL I'm not sure I totally understand. List<Contact> con = [SELECT Id, (SELECT Id, Name, CreatedDate, ContentType FROM Attachments WHERE ...
1 vote
1 answer
140 views

Why are child records I'm inserting in my test class not appearing?

an amateur apex user here and I have a question which I've tried to distill below as much as I can. I have a class OrderTriggerHandlerV2 which fires when Order.OriginalContractedOrder__c gets filled ...
0 votes
1 answer
1k views

How to refresh Related records & get the latest Count in LWC

I have a LWC Component added on Case object. Purpose of the component is to Change Ownership of the records and updates other fields on Case object. Once Ownership is changed, I have trigger which ...
1 vote
1 answer
92 views

confused while querying junction object

I am working on a batch and am writing a query but am getting confused because of the relationship... The batch is written on a junction object, Account_BOB__c, between 2 parents Account & ...
0 votes
1 answer
68 views

Query sibling records and throw an error if % greater than 100 [closed]

I have the Opportunity object with children records called Workshare__c. There is a field on Workshare__c that is a percent (Work_Share_percent__c). We don't have any rollup fields available on the ...
0 votes
0 answers
287 views

Update Parent object record from multiple Child records?

We have a custom object (domain) with subscription dates. I'd like to have a field on the account object but bring in the subscription date from each domain that is associated with the account. Ie: ...
1 vote
0 answers
511 views

Adding/removing records in a child relationship list

I am passing a list of SObjects with child relationships to a Lightning Web Component. If I query and pass my query results back to my LWC component directly, this works. In Apex: return [ SELECT ...
3 votes
1 answer
2k views

How to show Contacts of Account according to hierarchy on VF page?

I have a requirement where I need to show contacts based on Account hierarchy on Account layout. For example : The below is 3 level one,but we can have up to 5 levels **Grand Parent** - See All ...
0 votes
1 answer
1k views

SOQL relationship query returns objects. Why?

I have a custom object called 'Intake_New__c' that has a lookup field to an Account object called 'Third_party__c'. The account object 'Third_party__c' has a Hierarchy field on it called 'Parent ...
1 vote
2 answers
160 views

How to structure objects so this subquery works

I have a custom object that looks like this MyObject__c -- Company__c (ref to Account) -- ParentCompany__c (ref to Account) -- CompanyType__c (picklist: Parent/Child) -- (a lot more data and ...
0 votes
1 answer
636 views

Exception: Aggregate query has too many rows for direct assignment, use FOR loop

List<sObject> activityRows = obj.getSObjects(activityType); Here activitytype is nothing but openactivity and closedactivity. I am wondering why am I getting this error. However I am not using ...
0 votes
1 answer
42 views

Don't leave Parent Page after adding a new Child object

I have an object: Parent and an object: Child on my SalesForce, the issue is that when I am on my parent object and I click on 'create new child' then I create this child, after confirming that child ...
0 votes
1 answer
1k views

After Deleting Parent Object in Master-Detail relation, what happens to the triggers we have created in child object

In a master detail relationship in child object if we created trigger on child object after delete.when parent is deleted will the trigger execute?
1 vote
1 answer
5k views

How to get child relationship name from Parent Object in Apex

In the following piece of code, i am trying to do a dynamic parent - child query public static void fetchRelatedRecords(SObject primaryRecord){ String recordId = (String)primaryRecord.get('Id');...
0 votes
1 answer
415 views

SOQL to get Assets with AccountId different from Parent.AccountId [duplicate]

I need to get all Assets X with X.ParentId != NULL, and the X.Parent.AccountId != X.AccountId. SELECT AccountId,Id,ParentId,Parent.AccountId,RecordTypeId,RootAssetId FROM Asset WHERE ParentId != NULL ...
1 vote
1 answer
40 views

Fairly complex salesforce formula help

I'm trying to trigger a workflow rule over several criteria including a check against related objects (Line items) record type names. The idea is that if this all evaluates to true, it will trigger a ...
0 votes
1 answer
2k views

Control picklist values visibility

I have a custom object called "A". I have a custom object called "B". Custom object "B" is related to custom object "A" via lookup field. In custom object "A" as well as in custom object "B" I have ...
0 votes
0 answers
316 views

Blank value returned when referencing a custom field on a related custom object on the Account

I have created a Lookup Relationship on the Account object to a custom object named Installation (API name Most_Recent_Installation__c). I want to be able to show a field from this related object on ...
4 votes
1 answer
652 views

Creating child relationship with reference fails via Composite Tree REST API

In my setup, Leads can have multiple Affiliates (custom object Affiliate__c), which is implemented through a child relationship and where each Affiliate consists of a name and the two related objects: ...
0 votes
0 answers
118 views

owner change in case with child record relationship master detail

I am changing the owner of the case and I have a master-detail with viewed notification object.everything is working fine .the problem is in changing the owner of the case does not transfer the viewed ...
0 votes
4 answers
1k views

Is there any way to retrieve sum of grandchild field values on parent object

I am trying to iterate from parent to grandchild. Is there any way to do this as I want to show the sum of grandchild field value on parent object. please suggest me the best solution to do this other ...
0 votes
1 answer
797 views

Didn't understand relationship 'Orders' in FROM part of query call [duplicate]

I have a problem to attempt to the Order object based on the custom Contact lookup. I use the query: select Id, (select id from Orders ) from Contact and the object looks like that: The error is: ...
2 votes
1 answer
967 views

SOQL with conditions on children

I'm unable to finish an easy query, I could use some help on this. I got a junction object called Creche_Zone_de_Tarification__c that links two objects (Account and Zone_de_tarification__c and that ...
0 votes
1 answer
37 views

How to nest a map to get a related structure

I want to display a relation Account>property__c>Booking__c>Order>OrderItem in a visualforce page. I want to nest the objects to represent these as parent>grandchildren> grand grandchildren>etc. I am ...
5 votes
1 answer
466 views

Any way to get Child Relationships without being bound by user permissions?

Question User object-level permissions limit the results of DescribeSObjectResult.getChildRelationships(). Are there any workarounds? I have submitted an Idea about this (https://success.salesforce....
0 votes
2 answers
751 views

Getting a record's sibling records in SOQL with a single query

I've looked high and low and cannot find an answer to this question. Lets say I have a custom object called Appointment__c which is a child of the Case object, I have a VisualForce page that is ...
2 votes
1 answer
2k views

Object that is used for Case Feed comments

I'd like to create a trigger that fires every time a user, either internal or an external community user, comments on a case. Here is my comment I do know that the CaseFeed object is used because ...
0 votes
1 answer
236 views

parent to child soql not working

i am at a wits end, any help greatly appreciated I have a child object named acf_address__c , that is a child of the contact object the child relationship name on the acf_address__c is called ...
8 votes
1 answer
523 views

If I know the API Name, how can I get and work with the Schema.ChildRelationship?

Like many SFDC developers, we have SObjects which are related to other custom relationships. So, for example, MyCustomObject__c could have a relationship with MyCustomRelationship__c which in Apex we ...
0 votes
1 answer
373 views

assign lookup of accountId contact value on case field (Compile Error: Invalid foreign key relationship: Contact.cases )

i'm fetching data from soql need to insert account lookup value(accountId) and contact lookup value (ContactID) in case create from email services here is my code: String con_Email = envelope....