Questions tagged [relationships]
Use relationships to associate an object with other objects in Salesforce.
552 questions
0 votes
1 answer
62 views
how do i get the api name of an AccountAccountRelation?
I have two kinds of Accounts. Their DeveloperNames are Agency and Site. Using SOQL, how can I determine the name of all agencies related to sites? On the interactive page, I can see that a site has a ...
0 votes
0 answers
39 views
Preventing children records on relation field from being modified after deep clone
Apparently, deepcloning a SObject or List<SObject> does not remove memory reference from collection of children. Account relatedRecord = new Account(Name = 'Init Account Name'); insert ...
0 votes
1 answer
151 views
Standard Name field allows Upsert and parent-linking in DML like External ID
I was playing around with a two Custom Objects, connected by Lookup relationships, and noticed that system allows to insert the children object with valid link to parent using just a standard Name ...
0 votes
1 answer
85 views
How to wire to a LWC all the cases (and its related objects) of the current user?
I'm trying to get every Case (and its related objects) of the current user, to show all that data on a LWC. I'm having problems with the apex class. I know the concept of a wrapper, but I can't get it ...
2 votes
1 answer
152 views
Linking to records in the same object using External ID and SObject Collection REST callout
I am trying to insert records into the RelatedParty__c object in Salesforce. This object has two key fields: CompositeKey__c (External ID) Parent__c (Lookup to RelatedParty__c). My JSON payload ...
0 votes
1 answer
156 views
Cannot connect custom data model object with standard data model object
I have a custom data model object appointments and I am trying to connect it to the standard data model object Individual. However, this doesn't seem to be possible, since the dropdown for the field ...
0 votes
1 answer
585 views
How two Data Model objects can be related in Data Cloud to be used in a report?
I have two tables which I want to bring to Data Cloud using Ingestion API. The first table, appointments, has columns like id patient_id The second table statuses has id appointment_id status I ...
0 votes
1 answer
99 views
Get parent relationships via sObject Describe
I have a question about how to get information about relationships from Salesforce. For example, let's consider the Parent relationship on Account. I know I can get information via childRelationships....
1 vote
1 answer
203 views
How to manage cascading delete behavior for custom objects with complex relationships in Salesforce?
In our Salesforce org, we have several custom objects with parent-child relationships, some of which are deeply nested (e.g., Object A → Object B → Object C). When we delete a record in the top-level ...
0 votes
0 answers
39 views
Is there a way to flip the parent/child data in an instance of SObject without a new SOQL query?
I have the following SOQL: public List<B25__Resource__c> getByIds(Set<Id> resourceIds) { return [ SELECT Id, B25__Parent__c, ...
0 votes
1 answer
304 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 ...
0 votes
1 answer
113 views
SOQL - Relationship extract json from child object and join picklist label
This soql SELECT Id, Name, (SELECT CountryISOCode__c, Name, Role__c FROM Person__r) FROM Market__c returns a row that looks like this: Id NAME Person__r a081.. C1 [{"A":"foo", &...
3 votes
1 answer
119 views
Get entire relationship from SObjectField
I am working on Selector Layer and I would like to avoid situations where the relationship name is passed as a String. My Goal SELECT Account.Owner.Name FROM Opportunity Approach 1: Use ...
-1 votes
1 answer
55 views
changing master details to lookup field in salesforce
I am preparing for advance admin of certification, one of the question is changing the master details relationship to lookup and deploying from sandbox to production. answer is to do by change set but ...
0 votes
1 answer
70 views
Test class for batch with another class called in it: Batch has 100%, but called class only 24% coverage [duplicate]
Batch class: public class BatchClassForCustomer implements Database.Batchable<sObject>{ public Database.QueryLocator start(Database.BatchableContext bc){ string query='...