Questions tagged [relationships]
Use relationships to associate an object with other objects in Salesforce.
519
questions
3
votes
1
answer
99
views
How to distinguish lookup and master-detail in APEX
Is it possible to check using Apex, is relationship field type of lookup or master-detail? Schema.DescribeFieldResult.getType() for both of them returns simply 'REFERENCE'
0
votes
1
answer
34
views
Can I chain Bulk API jobs?
I have to load millions of records in a data migration process and I'm dealing with a parent object and a couple of custom child objects. After initial load, data will keep flowing, as Salesforce has ...
0
votes
1
answer
21
views
Cross Object SOQL Query
I have three objects
Object A - Parent
Object B - Child ( Lookup to A)
Object C - Child (Lookup to A)
B and C are not related directly, I have to fetch the fields from object C where my query is ...
0
votes
1
answer
46
views
How to Query Child records of the lookup record in a single query
I have 3 custom objects
Organization__c
School__c
Student__c
The objects are related like below:
Object Organization__c has a lookup field School__c which is a lookup on the object School__c.
...
0
votes
1
answer
20
views
why do I see controlled by parent sharing setting for contact?
Why do I see controlled by parent sharing settings for contact even though the relationship between account and contact is only lookup. I tried to create a lookup between Account and a custom object ...
0
votes
1
answer
30
views
Update Parent Id In Existing Child Record
I am a new APEX learner.
I created two custom objects : Book & Author, where Author being Parent and Book being child object.
I created Child : book record 'Harry Potter' with Parent : 'J K ...
0
votes
1
answer
34
views
Junction object allows to create only one related list
I have created a junction object that relates Case (with related list "A") and Account (with related list "B") objects with each other. I want to place both Related Lists on the ...
0
votes
1
answer
76
views
Can we create Junction object with one master-detail and one lookup field?
Can we create Junction object with one master-detail and one lookup field? What will be its security configuration in case Lookup relationship field is created first?
-3
votes
1
answer
32
views
how to edit relationship fields in salesforce [closed]
can we edit relationship fields in salesforce, like editing account name in opportunity details
page without navigating to account tab. If anyone has implemented using visualforce page, please post ...
0
votes
2
answers
32
views
Trigger not updating parent field with child field
I have a problem with a trigger.
I have this situation:
Question is: At each insertion of "Registrazione Visita", the owner's "Da pagare" field will be updated with the costs of ...
0
votes
0
answers
68
views
How to build a report on objects connected by a text field?
Let's consider an example data model with two objects connected with a relationship as follows:
A general request is to make it possible to build any type of report that could list Custom Objects B ...
0
votes
1
answer
17
views
What does referring to a child relation of an object return?
Custom Object Maintenance_Request__c has master Detail relationship to Custom Object Vehicle__c (Child Relationship Name = Maintenance_Requests).
In the Following code
for(Vehicle__c veh : v){
...
0
votes
1
answer
35
views
How To Access Field f of an Object A to which Object B is having a master detail relationship using Object B?
I have a Custom Object called Vehicle__c which has a Master Detail Relationship with Contact.(Vehicles owned by contacts);
Another Custom Object Called Maintenance_Request__c which has a Master Detail ...
-1
votes
1
answer
43
views
How to link Account with Event in a SOQL Query
I need a SOQL Query to List of Ids from Account older than 14 years and with no Events in the Last 6 Months.
I tried to "link" both requests with whoId relation on Event:
SELECT Id, ...
0
votes
1
answer
102
views
Is the "Delete this record also" option for Lookup relationships available only after getting the 'Cascade-Delete' option enabled for your org?
When creating a new Lookup Relationship on a custom object, there should be 3 behaviours to choose from when the parent object record is deleted (according to documentation):
Clear the value of this ...
1
vote
1
answer
204
views
Salesforce REST API not allowing to create records by using a reference field
I have 2 custom objects: custObj1 & custObj2. It is a one:Many relationship between the 2. I have set up a lookup relationship under custObj2. Wallet_Address__c is on both objects and is the ...
0
votes
1
answer
26
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 ...
0
votes
1
answer
39
views
Correct Sales Cloud life cycle understanding?
I have created a flow diagram, to represent my Sales Cloud flow understanding.
Can you all tell me whether this flow/understanding is proper?
I fully didn't understand the need & working of ...
0
votes
0
answers
49
views
How to use maps to get list of grand child records for a parent object
I have a parent object (Account), child object(Contract) and a grand child object(contract exceptions). Contract exceptions has master detail relationship with contract. My requirement is to fetch ...
0
votes
0
answers
24
views
Mutation master-detail to lookup on delete/undelete
According to this materials via delete/undelete a junction object the relationship will be changed to the lookup from the master-detail.
I am trying to reproduce this but with no success. Someone can ...
0
votes
1
answer
533
views
NavigationMixin for standard_recordrelationshipPage using a listview developername
Question:
is there a way to use a developer name of listview in a standard_recordrelationshipPage?
In Account object I created a custom single related list in LWC called Active Campaign Related List.
...
0
votes
1
answer
27
views
Create a second Record on the Same object just after an Insert
I have a custom object called Account Relation. When creating a record on this object which is related to an Account. I need to automatically create a 2nd record on another related Account record with ...
6
votes
0
answers
100
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
0
answers
21
views
Display external object details on related record
We are working on setting up external objects to pull data from an internal database in order to display additional information about an account that is not stored in Salesforce. So since they user ...
0
votes
1
answer
74
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 "...
0
votes
1
answer
2k
views
Display related fields in LWC Datatable [duplicate]
Trying to display related fields from junction object linked to 2 objects vis Master Detail :
@track columns = [{
fieldName: 'related_field__r.Name',
label: 'Name',
type: "text",
...
-2
votes
2
answers
123
views
Query RecordType of a Contact from WhoId of an Event or Task [closed]
I would like a list of all task/events which are concerning to a account record and and a contact record and the contact has a specific recordtype
I have the whoid, but how can I query the recordtype ...
0
votes
1
answer
25
views
Query AccountId from LinkedEntityId
I would like a list of all files which are concerning to a account record, but my files have only a relation to the contacts. How can I query all files of the account?
The LinkedEntityId is from a ...
0
votes
2
answers
90
views
Query to filter Accounts with specific products, using Opportunity LineItem
I wanted to pull in a query all of our customers that have bought an specific product,I tried to do it like this, but I got an error telling me that I cannot have more than 1 level of relationships:
...
0
votes
1
answer
549
views
Showing related object fields in a custom aura component
First time with Aura components, having a hard time understanding them.
I'm trying to write a simple component that shows some related object fields. I know there's a standard one provided by ...
0
votes
1
answer
19
views
The field of checkbox type isn't available when I try to make a new object
The field of checkbox type isn't available when I try to make a new object.
0
votes
2
answers
85
views
My query is returning one record, but without any data in it
I have this query to get the related data and update it, if it exists. In interface im not seeing any data, but sfdc somehow is fetching one row without any values in it.
0
votes
1
answer
123
views
Soql query to retrieve data from three related object
I have three custom objects: Book, Loan, and Reader. Loan is a junction object with lookup relationship with both Book and Reader. The diagram below shows their relationship:
I want to write a SOQL ...
2
votes
1
answer
56
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
2
answers
29
views
What would make a related field return no results when there is data?
I am trying to debug some code that I found in an org that I joined. We have a test that is failing because of null results. If you look at the code below, there is test data created for student and ...
14
votes
1
answer
624
views
Can someone confirm if I've identified a bug in Salesforce regarding formula fields?
I believe I've identified a bug in Salesforce related to formula fields. Can some of my fellow developers, and admins too, confirm if I am observing unexpected behavior? I do have a workaround.
The ...
-2
votes
3
answers
90
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?
0
votes
1
answer
57
views
Relationship upload
I have a list of students and their corresponding emergency contacts to upload into SF. I would like to have the emergency contact connected to the student in some way (i.e. have SF reflect that ...
0
votes
1
answer
43
views
Apex and SOQL Layered Updating
So I'm a little confused on how to do this. I'm trying to make a scheduled apex job to do some cleanup.
A) On Account I am looking for Accounts with Type != "Type1" and Type != "Type2&...
0
votes
0
answers
68
views
Get Campaign name from _Sent dataview [duplicate]
I downloaded the _Sent dataview to my server. Now I need to join the _Sent data with the campaign names to filter. How can I get from the _Sent dataview to the campaign name?
0
votes
1
answer
32
views
Difference between a straight query and a relationship query
I'm trying to understand the performance difference or query execution time between direct SOQL query and relationship query. For example, I need data from Account and User object. sap_id__c is the ...
0
votes
1
answer
1k
views
Create a lookup field on User object to Account Object
I want to have a related list 'Partnership Managers' on the Account object. All the partnership managers comes from the User object. For example, one account can have multiple partnership managers (...
1
vote
1
answer
41
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
0
answers
36
views
Why Opportunity object has special features than others [duplicate]
I need a little explanation on Opportunity object. I was wondering Account and opportunity objects are in Lookup Relation but acting as Master-Detail. Also in workflows, we can update Account Records ...
0
votes
1
answer
50
views
How to share notes between two objects
I have two objects subject and subject requirements.
The subject has a master details relationship with the subject requirement. what I would like to do is if I write something in the subject ...
0
votes
0
answers
134
views
PB formula to compare an ID field to a text field?
I have a Relationship Process Builder that populates a Contact text field based on Status=Current and clears the field if someone changes the Status=Former. So far so good. Now how to get the ...
1
vote
1
answer
216
views
confused with accessing variable in batch apex
Got a little confused while trying to access a variable in my batch. I update a certain field on Contact based upon the LOB field as queried for in my initial query (line 2). However, when I later try ...
2
votes
1
answer
48
views
How to discard the parent and child SObjects when they are queried at the same time as the root object?
I have an Apex @AuraEnabled method that queries a collection of root objects and also several parent/child objects all at the same time. I have programmatic filtering of the child objects (returned in ...
0
votes
1
answer
131
views
Parent / Child SOQL WHERE condition where child field match with parent field
I wasn't able to find the answer on the forum: I have an easy query which involve a where condition with parent/child relation.
Here is what I'm looking to achieve:
Select Id, ProductCode, EAN__c, ...
0
votes
0
answers
34
views
Hide Site Guest User When Assigning Users
We recently created a two public sites, where we've enabled apex classes. The only purpose of these sites are to update a record field when called. The Apex classes have @RestResource(urlMapping='/<...