Questions tagged [childrelationship]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 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
1answer
42 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 ...
1
vote
1answer
34 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
1answer
23 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 ...
0
votes
0answers
17 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 ...
5
votes
1answer
91 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
2answers
41 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 ...
1
vote
1answer
62 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 ...
8
votes
1answer
213 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
1answer
67 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 ...
5
votes
1answer
144 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
141 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". ...
5
votes
1answer
122 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....
13
votes
1answer
146 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) { ...
1
vote
2answers
305 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 ...
4
votes
0answers
152 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: ...
1
vote
1answer
116 views

move all child records from one account to another efficiently

I did a bit of searching and didn't come up with anything so apologies if this is a duplicate, but - Situation: I am looking for a way to migrate all related object records from one (bad) account ...
0
votes
1answer
108 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 ...
0
votes
3answers
120 views

SOQL & Custom relationships

I'm trying to understand how to query using relationships, I'm facing an issue I don't understand, Here is what I'm trying to resolve : I'm trying this, but it seems to be wrong.. Can you help me ? ...
1
vote
1answer
131 views

How can I translate a “child relationship” reference into an object API name (external software via API)?

I'm poking around, writing a Python script to fetch ".reportType" XML files for all ReportTypes in an org and then do various things to those files. First up is figuring out what tables they include. ...
0
votes
1answer
540 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 ...
5
votes
1answer
2k 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
1answer
44 views

Creating test data for custom parent object and child object in test class

I am writing test class where I need to create test data for standard case object object and parent object for a custom field in case object. When I do the test run it is giving error at the ...
0
votes
1answer
36 views

SOQL required for a SQL

Cam someone please convert the below SQL query to SOQL? SQL: Select id, Name, product_code, (select product_code from product b where b.parent_id=a. id) as parent_code from product a How to ...
3
votes
1answer
543 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
0answers
67 views

Fetch records from child relationship using Apex [duplicate]

I have a remote action that need to fetch an object child relationship data, but the catch is that is has to be dynamic. For example, the remote action will get Case, CaseComments, list of fields in ...
1
vote
0answers
46 views

SOQL query on multi object [closed]

I'm trying to build a query on workbench to get the Name and Stage of opportunities created this quarter when there is task created by rep A or rep B on that account or on any of the contacts ...
3
votes
2answers
133 views

Child Relationships in SOQL Queries Aren't Working

So I have these 3 queries, and all of them throw an error about the relationship not being recognized. this.lineItems = [SELECT QuoteLineItems.Product2Id FROM Quote WHERE Id = :activeQuote.Id]; [...
0
votes
1answer
187 views

related field through lookup

I have a custom object with a lookup field to the standard object Contact. If I use the custom object as a standard controller how do I acces the salutation and lastname on the contact object. I tried:...
1
vote
1answer
1k views

Query opportunities with open activities

I would like to be able to query all opportunities that have open events. So far, I know how to do it with SOQL + Apex, but is there a way to do it just with SOQL? I'm looking for something like this ...
1
vote
1answer
1k views

Want to fetch the child relationship name from the Lookup field name?

I am developing a functionality where I am to check for the presence of Child records, before executing a part of code. I can't do hardcoding since my code is going to be a part of a managed package, ...
0
votes
1answer
1k views

Multiple Sub Query using child parent relationship

Consider in my basket, I have a package (Main Product-just a holder) which will have 2 standalone products (child) and again the standalone products will have child products (Grand Parent). All these ...
0
votes
1answer
115 views

Add related list Id to List

I have a SOQL query which gives me the fields i expect: [Select (select Id,Name from signrequest__SignRequests__r) from Lead WHERE Lead.Id='00Q0Y000003iRelUAE'] But when i try to place the ids in a ...
0
votes
1answer
267 views

SOQL Ids on a related list

I want to query ids on a related list from a lead. When I look up the related list name in the wsdl it says: <complexType name="Lead"> <element name="signrequest__SignRequests__r" nillable="...
0
votes
1answer
67 views

insert a related list from a indirect relationship

I have an Account object, a related (master detail) contact object and a custom object Automobile__c that has a lookup to the contact. I would like to display the related Automobile__c records on the ...
7
votes
1answer
81 views

Programmatically Determine Which Objects Allow Lookup References to Them?

I'm wondering if there is a way, via apex, to retrieve all objects that would allow a lookup field on another object to reference them. For example, for a custom object obj1__c, I can create a lookup ...
0
votes
1answer
1k views

How to do a batch job to update a field in a parent object from multiple child object fields?

I have the custom object Project, which has a child Payers. One project can have more than one Payer. Payer has a field called Billing Percentage. Payer is a child of Account and Project has a lookup ...
0
votes
3answers
53 views

Show list of child records in table view?

I have a custom object that links to "Contact" and would like to display the list of all related records of the custom object in the "Contact" list view. Is this possible? So if I had, for example: ...
4
votes
2answers
3k views

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

I am trying to query the child record using the parent record id. I understand that we have to use the child relation name in the inner query to get the child records. select id, (select id from ...
5
votes
1answer
152 views

SOQL query with inner query doesn't recognize understand the relationship

I'm trying to write a SOQL query that will retrieve a list of Content sObjects and return it's related child Attribute sObjects. First I wrote the SOQL query to grab the parent records, and it ...
2
votes
1answer
73 views

How to use Sfdc.ChatterNotes.createNote() in my visualforce page to add a Note to my custom object?

I'm trying to have a button in my VFP that'll add a Note (AttachedContentNote) to my custom object. I want my button to do the same as the New Note button from the Note's relatedList in my custom ...
1
vote
1answer
648 views

How can I create a hierarchy (parent/child relationship) within the same object?

I have custom object Territory that can have a parent Territory and child Territory. For example, Territory "United Kingdom" with child territories "Scotland", "Wales", "North Ireland" etc. Each of ...
0
votes
1answer
138 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....
1
vote
1answer
537 views

fetching account lookup value on case in inner query

I am fetching account lookup value in class using inner soql query but it throwing error Compile Error: No such column 'Account' on entity 'Case'. If you are attempting to use a custom ...
2
votes
3answers
2k views

Where do I find this related list API name to access in query?

I have a related list on my Contracts for Orders. I am querying for certain contracts, and I want to Select ID, startdate, and some other fields, along with its corresponding related list of orders. I'...
0
votes
2answers
543 views

I cannot create child object to junction object

I have a junction object(JuncObj) with a custom object(ParentObj1) and contact as the masters. I've created a separate obj(NewChildObj) that is supposed to be a child object of JuncObj. When I create ...
1
vote
1answer
93 views

Child relationship expressions __r in SOSL [duplicate]

Is that possible to have a child relationship expressions __r in SOSL List<List<SObject>> searchList = [FIND :searchText+'*' IN All Fields RETURNING Account (id,name,industry), ...
0
votes
0answers
204 views

Child Relationship use in Visualforce

In a visualforce page I can get a list of child records directly (without any query) using the child relationship name like {!ParentObject__c.Child_Relationship_name__r} and this list is of the type ...
2
votes
1answer
727 views

Bulk-API insert with sObject Tree

I am attempting to do an insert of thousands of record using the Bulk-API, which is in itself is not complicated. The thing that I am having trouble with is insert both Record and Child. For example, ...
1
vote
2answers
5k views

SOQL to determine if parent has child records

Simple and short question, what is the cheapest way to query (plain SOQL) if an object has child records? I want to avoid running into limits even if there are parents with millions of child records.