Questions tagged [childrelationship]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
38 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 !...
user avatar
0 votes
1 answer
143 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 ...
user avatar
0 votes
0 answers
58 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 ...
user avatar
0 votes
0 answers
256 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 ...
user avatar
0 votes
0 answers
16 views

Salesforce relationship [duplicate]

When A child object having two master detail relationship with two different parent objects. Here which parent record owner will restrict the child records ?
user avatar
0 votes
1 answer
39 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 ...
user avatar
  • 185
1 vote
0 answers
111 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 ...
user avatar
1 vote
0 answers
20 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'...
user avatar
  • 511
6 votes
0 answers
152 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....
user avatar
  • 33.7k
0 votes
0 answers
65 views

Is there any possibility to get dynamically child relationship names based on dynamic query/record?

Is there any way to get dynamically child relationship names from the dynamic query or even from the record(records)? Here is an example: String soql = `SELECT id, Custom_Field_1a__c, ...
user avatar
  • 11
0 votes
1 answer
133 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 "...
user avatar
1 vote
2 answers
691 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/...
user avatar
0 votes
0 answers
229 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 (...
user avatar
2 votes
1 answer
68 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()); } ...
user avatar
  • 13.4k
0 votes
1 answer
374 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 ...
user avatar
-2 votes
3 answers
122 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?
user avatar
  • 465
1 vote
1 answer
218 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 ...
user avatar
1 vote
1 answer
71 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 ...
user avatar
  • 132
0 votes
1 answer
706 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 ...
user avatar
1 vote
1 answer
49 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 & ...
user avatar
  • 77
0 votes
1 answer
46 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 ...
user avatar
  • 23
0 votes
0 answers
193 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: ...
user avatar
1 vote
0 answers
194 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 ...
user avatar
0 votes
1 answer
862 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 ...
user avatar
  • 481
1 vote
2 answers
127 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 ...
user avatar
0 votes
1 answer
234 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 ...
user avatar
  • 229
0 votes
1 answer
604 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?
user avatar
1 vote
1 answer
2k 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');...
user avatar
  • 1,123
0 votes
1 answer
163 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
0 votes
0 answers
84 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 ...
user avatar
0 votes
0 answers
93 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 ...
user avatar
  • 1
4 votes
2 answers
3k 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 limits ...
user avatar
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 ...
user avatar
  • 37
0 votes
1 answer
556 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: ...
user avatar
  • 115
1 vote
1 answer
563 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 ...
user avatar
0 votes
1 answer
30 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 ...
user avatar
  • 2,146
0 votes
1 answer
34 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 ...
user avatar
5 votes
1 answer
288 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....
user avatar
0 votes
2 answers
519 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 ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
  • 2,708
8 votes
1 answer
451 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 ...
user avatar
0 votes
1 answer
72 views

Retrieve data on a single query

I need to retrieve an object's info from a single query. Lets say I have 4 objects (A__c, B__c, C__c, D__c). The relationship is that B__c has the master-detail relationship with A__c and B__c is also ...
user avatar
6 votes
1 answer
1k 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 +...
user avatar
  • 33.7k
0 votes
1 answer
738 views

Display related list dynamically

I have requirement to display few related list based on the profile for that i have design the separate page for that. Below is the apex code to get the Related child names ie.. "relatedListNames". ...
user avatar
  • 2,464
5 votes
1 answer
433 views

Prevent New Child Record without triggers

I am trying to find the best method, that will work both in classic and lightning, to prevent a user from creating a more than 1 child record from a parent object; e.g pressing 'New' on a related list....
user avatar
13 votes
1 answer
154 views

Can Cast Child Related List to Single SObject Record - Compiler error?

This situation came up in code review and I was sure the old version should have caused a compile fail: List<Child__c> children = new List<Child__c>(); for (Parent__c parent : parents) { ...
user avatar
  • 144k
2 votes
2 answers
2k views

Getting SF report information using SOQL

I have a SF report created in the Salesforce of type 'Contacts With Opportunities'. I need to set the ETL automation for this report using python.: Please have a look at following screenshot: I have ...
user avatar
4 votes
1 answer
474 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: ...
user avatar
  • 61