Questions tagged [childrelationship]
The childrelationship tag has no usage guidance.
93
questions
-1
votes
1
answer
30
views
Find all Parent and Child from Child relationships with isCascadeDelete == true
Let's say i can retrieve it this way
for(Schema.DescribeSObjectResult result : Schema.describeSObjects(new String[]{'Account'})) {
for(Schema.ChildRelationship cr : result.getChildRelationships()){
...
0
votes
1
answer
91
views
SOQL query to get Lead attributes from Account via converted account relation
I'm trying to get the Leads columns from the Account object.
This is the type of query I want to run, but it doesn't work:
SELECT Account.Name, (SELECT Name FROM Account.Leads) FROM Account
If I ...
1
vote
1
answer
233
views
How to recursively iterate through multi nested arrays in the lwc's html file?
I have the following data and nested a way to recursively call the same logic so that regardless of how many levels are in the data, the data is always printed correctly in a nested format.
Example ...
2
votes
1
answer
294
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());
}
...
1
vote
2
answers
10k
views
How to query to get the Quote and QuoteLineItem from opportunity?
I queried quote from opportunity using child to parent relationship. I need to get the all QuoteLineItem records from quote using same query. Could anybody help on this.
Soql Query:
List<id> ...
0
votes
0
answers
28
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
140
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
3k
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
6k
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
40
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
8k
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
90
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
1k
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
113
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
411
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
74
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
317
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
535
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
689
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 (...
0
votes
1
answer
2k
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
531
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
606
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
3k
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
198
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
100
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
82
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
292
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
694
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 ...
1
vote
1
answer
2k
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
172
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 ...
1
vote
1
answer
1k
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
45
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?
2
votes
1
answer
6k
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
508
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
367
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
718
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
143
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
2k
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
879
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
1k
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
40
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
519
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
849
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 ...