Questions tagged [childrelationship]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 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 ...
JEbert's user avatar
  • 1
-1 votes
1 answer
26 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 ...
SFDC Dev 27's user avatar
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, ...
Lauren Truby's user avatar
-1 votes
1 answer
69 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 !...
pangloss's user avatar
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 ...
ajmal khan's user avatar
0 votes
0 answers
832 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 ...
Chris St.'s user avatar
0 votes
0 answers
994 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 ...
GroundToCloud's user avatar
0 votes
1 answer
103 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 ...
CPS's user avatar
  • 305
1 vote
0 answers
295 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 ...
Alexandra Mallow's user avatar
1 vote
0 answers
32 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'...
jbyrd's user avatar
  • 601
6 votes
0 answers
244 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....
Uwe Heim's user avatar
  • 28.1k
0 votes
1 answer
378 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 "...
Alice Heaton's user avatar
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/...
Rhonda Gutman's user avatar
0 votes
0 answers
522 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 (...
user2542953's user avatar
2 votes
1 answer
196 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()); } ...
Patlatus's user avatar
  • 15.8k
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 ...
salesforce Developer's user avatar
-2 votes
3 answers
399 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?
Ravi Teja's user avatar
  • 465
1 vote
1 answer
480 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 ...
Lilla Székely's user avatar
1 vote
1 answer
132 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 ...
Tom G's user avatar
  • 170
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 ...
SFDCDJ's user avatar
  • 1,802
1 vote
1 answer
87 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 & ...
sfn00b's user avatar
  • 77
0 votes
1 answer
62 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 ...
LMills's user avatar
  • 23
0 votes
0 answers
286 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: ...
Laura Chickery's user avatar
1 vote
0 answers
451 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 ...
Matthew Souther's user avatar
1 vote
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 ...
kratos's user avatar
  • 521
1 vote
2 answers
156 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 ...
jwatts1980's user avatar
0 votes
1 answer
574 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 ...
NBR's user avatar
  • 229
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?
mouli nandamuri's user avatar
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');...
Madhurima's user avatar
  • 1,235
0 votes
1 answer
385 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 ...
Omar Villasmil's 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 ...
Laurence Evans's user avatar
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 ...
user12347's user avatar
0 votes
0 answers
268 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 ...
Scott Westbrook's user avatar
0 votes
0 answers
113 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 ...
zurair's user avatar
  • 1
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 ...
MichaelLev19's 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 ...
Anoop's user avatar
  • 47
0 votes
1 answer
766 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: ...
Quicki's user avatar
  • 115
2 votes
1 answer
891 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 ...
Alexis MASSON's user avatar
0 votes
1 answer
36 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 ...
Thomas's user avatar
  • 2,294
0 votes
1 answer
36 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 ...
Oneal Revellin-Falcoz's user avatar
5 votes
1 answer
443 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....
Charles Koppelman's user avatar
0 votes
2 answers
706 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 ...
Sugam Manocha's user avatar
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 ...
Tyler Zika's user avatar
  • 2,808
8 votes
1 answer
520 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 ...
Brian Kessler's user avatar
0 votes
1 answer
79 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 ...
Salesforce Learner's user avatar
4 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 +...
Uwe Heim's user avatar
  • 28.1k
0 votes
1 answer
843 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". ...
NITHESH K's user avatar
  • 2,515
5 votes
1 answer
513 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....
user59760's user avatar
13 votes
1 answer
156 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) { ...
Adrian Larson's user avatar
  • 149k
2 votes
2 answers
3k 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 ...
Subhash Deshmukh's user avatar