Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [relationships]

Use relationships to associate an object with other objects in Salesforce.

1
vote
1answer
34 views

Check box field on Parent object based on child object record type

I am trying to create a checkbox formula field on Account object. This is to be checked based on the record type and isactive field in another object (say Rel__c Object). These two objects have a ...
0
votes
0answers
44 views

How master-detail records are synchronized/accessible in junction object?

I have a Juction object CaseJiraItemAssociation__c which is have two master-detail relationship (on Case__c and JiraItem__c custom objects) and I have one outbound message (end point) on JiraItem__c ...
1
vote
2answers
22 views

Alternative of master-details relationship on standard and custom object sult

We have two object Opportunity(Standard) and Result(Custom), Now many opportunity connected to result object and we want some of opportunity amount to result object(like rollup), But We can't ...
2
votes
1answer
20 views

How to update child in Master-Detail relationship with REST API?

I have a Master-Detail relationship with Accounts and Locations. I am able to create the child using upsert, but when I try to update the Account__c field I get (INVALID_FIELD_FOR_INSERT_UPDATE: ...
5
votes
1answer
65 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
42 views

to access username field using LoginHistory Object

I am trying to access Username field (which is present in User Object) Using LoginHistory Object as follow: SELECT+Username+FROM+LoginHistory but is shows below error: [{"message":"\nSELECT ...
1
vote
1answer
33 views

SOQL Relationship issues

I am trying to write a SOQL query to pull out a number of items from 3 Objects - Contact, Account and Case. I have the following code: SELECT id, accountid, contactid, contact.primary_contact__c ...
0
votes
1answer
52 views

Related search for lookup. I have 3 different obj, Opportunity, Brand__c and Corporate__c

Flow is, 1st I register Corporate(Independently) and then brand. Each brand is associated to one corporate. In opportunity I want to choose Corporate which is a direct lookup and then Brand. Question ...
0
votes
0answers
18 views

Is it possible to reference custom field names of a child object in a text field to be used like a merge field on the child object?

I am trying to create a way to use templates and merge fields on custom objects just like you can use merge fields on email templates using text fields and a field updates. For example: I have 2 ...
1
vote
1answer
32 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 ...
2
votes
1answer
79 views

Didn't understand relationship 'Opportunities' in FROM part of query call

This is a real estate development that has a Development object and a Property__c object. Properties can be related to a Development or not. Also, properties are tied to opportunities. Now I need ...
0
votes
1answer
48 views

Cloning Parent -> Child -> Grand Child

I have one similar problem asked here. But My Objects are Project(Parent) -- > Milestone(Child) --> Action(GrandChild).. Deep Clone (Parent -> Child -> Grand Child) I have tried using the ...
1
vote
1answer
45 views

Create lookup field that can relate to two types of objects

I have a custom object, that I would like to relate to the built-in Accounts and Opportunities objects. Sometimes this custom object can be related to an Account, sometimes it can be related to an ...
0
votes
1answer
17 views

Retrieve a Filtered Data extension with fields of both the data extension

We are using Data Relationships as a Data Filter to retrieve data from two data extensions, but the filtered data extension has fields only that of the source data extension. What must I do so that I ...
0
votes
0answers
79 views

Issue upserting Account Contact Relationship - INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: AccountId

I'm upserting Account Contact Relationships the first load, works fine and we are upserting on a customer external ID field. When the upsert is run a second time - we see this error in the logs: "...
0
votes
1answer
44 views

Getting custom object data related to another custom object

I have been following this article to try and retrieve data for a custom object's related data. Basically, I have a Student__c object, and I have a StudentCourseRelationship__c object. the ...
0
votes
2answers
119 views

Many Lookup Relationship for One Object

I have the case of an object having two lookup relationship and I call for a list containing both relationship as follows. This is my Setup code public static List<Job_Application__c> ...
2
votes
1answer
70 views

Dynamic lookup? What is the best practices?

I know that lookup is 1-M relationship between just two objects. Tried to find but so far wasn't able a proper way. Maybe someone faced the same case and can share or give an advice? Use case: I want ...
0
votes
3answers
32 views

Get Custom Relationship Object's Name instead of Id into a List

I have a custom relationship to campaign object from opportunity object. When I am doing this: List<sObject> opportunities = [SELECT Name, Campaign__r.Name FROM Opportunity]; for (Integer i = ...
0
votes
1answer
43 views

Can't get SOQL statement to work for related object

I have an object Tourist_Details__c which has 2 child objects Contacts and Incidents__c. I already have a list of Incidents__c called results and now I need to get a list of all Tourist_Details__c ...
1
vote
1answer
50 views

Custom Relationship Field Limit not reflecting deletes

If I add a custom field to an object that is a Lookup() in the Fields & Relationships section of an object, the Object Limits page for the object shows an immediate increase counting against the ...
0
votes
1answer
43 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 ...
1
vote
1answer
65 views

How to use the isUpdate() trigger handler on lookup relationship?

I have a custom object Hire_Form__c that has a contact lookup. It has the following fields: First Name Last name Email Phone Status (In Progress , Completed , Rejected) Candidate (Contact Lookup) ...
4
votes
1answer
85 views

Proper way to make Contract-Order, force 1-1 relationship

I'm looking out for a way to make the relationship between Order and Contract, 1-1, The relationship between both, is optional, but still, I'm unsure if I need to add a custom field to Contract that ...
0
votes
2answers
25 views

Combine and Query 2 Child object to a Parent Object

I was wondering can you combine 2 child objects to a parent object. SELECT SourceIp FROM LoginHistory WHERE UserId IN (SELECT Id FROM User) SELECT City FROM LoginGeo WHERE CreatedbyId (SELECT Id ...
0
votes
2answers
83 views

What happens when I delete the Task related to an EmailMessage?

We're looking for ways to get rid of some data in several orgs. One potential target would be the Task records that get created along with every EmailMessage. (I.e. the Tasks of which the Id is stored ...
0
votes
1answer
27 views

I can not link Note to a contact

I am writing a very simple plugin which creates Contact and associate a note to it. I noticed that to add a note to a contact, I should first create the contact after that add the note here is my ...
1
vote
1answer
65 views

Relationship query issue between case and a custom object

I have a Case object related to a Custom Object work part (Api Name- Work_Part__c ). Case is the parent object. I am trying to fetch all the work parts related to a case using below query List<...
0
votes
1answer
94 views

How to get the name of the relationship for inner queries in SOQL? [duplicate]

In Trailhead we have the query to get the Contacts for the Account named "SFDC Computing", with an inner query. SELECT Name, (SELECT LastName FROM Contacts) FROM Account WHERE Name = 'SFDC Computing'...
0
votes
1answer
57 views

Help updating record's field with lookup's child record

I have three objects: Order__c Package__c Account Package has a relationship with account and order. Order has a relationship with account. If a package has an account attached to it, how can I ...
1
vote
1answer
96 views

Many to Many Relationship on OpportunityLineItem, and similar Junction Objects.

I'm trying to add special characteristics that are not entirely products, so I thought, that the best way would be to make a many-many relationship between the Opportunity Line Products, Quote ...
3
votes
1answer
291 views

Deleting Custom Objects

I have three connected Custom Object I'm trying to delete. When I attempt to delete them, I get the following message. 'Your attempt to delete .... could not be completed because it is associated ...
0
votes
1answer
102 views

How to display in visualforce a related object - not related list

Hello I want to relate a custom object to OpportunityLineItem but OpportunityLineItem cannot have a lookup field pointing to it. I have a custom text field referencing the OpportunityLineItem Id - I ...
-3
votes
1answer
38 views

data modeling relationships [closed]

As I am analyzing standard objects, it's quite easy to understand Accounts Related Tab shows contacts as there is a lookup relationship on the contact object on AccountID field. On a similar ...
0
votes
0answers
6 views

How to restrict user from adding child record on parent object

How to restrict user from adding another child record on parent object, if parent already has 1 child associated to it
1
vote
1answer
76 views

Traverse a Relationship of Unknown Depth

Update: Okay so this was marked as a duplicate, which I can appreciate, because it is similar to the question posed here: Get 10+ Level Hierarchy Relationship - however, I believe mine differs ...
0
votes
1answer
101 views

Maximum number of children allowed in a parent-to-child lookup relationship

Is there any limit on the number of children a parent can have in a lookup relationship? If there is no limit, Is there any good practice guideline with regards to the number of children added to a ...
0
votes
1answer
73 views

Create one grandchild record per child record

I need to create automation that creates one grandchild record per child record, when criteria are met on the parent record. The initial criteria are straightforward: two field values on the parent ...
0
votes
3answers
112 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
49 views

Traversing Contacts though Account object Visualforce

I have a Visualforce page with a standard controller Account. I want to access a rich text field in a related Contact. Below is what I tried: <apex:outputText value="{!Account.Contacts__r....
3
votes
2answers
399 views

Performance-wise, is it better to query a relationship field or a formula field?

Like AccountName vs Account.Name. The first being a formula field, and the second one a relationship. Since formula fields are like Schrödinger's Cat (the value depends on the time you are getting ...
0
votes
3answers
499 views

Why Owner relationship is not available for custom objects and for some standard object like Case?

This seems to be very strange. While we can use Owner relationship explicitly for many standard objects like Account and run this code without problems Account a = [ select Owner.Id from Account ...
0
votes
0answers
61 views

Get nested relationships dynamically in Apex

I am building a dynamic SOQL from a JSON file. As of now, I am able to build SOQL for direct parent and direct child objects dynamically. However, I am stuck at a complex/deep relationship. E.g. ...
-2
votes
1answer
79 views

How to get Case Owner Name from case object [duplicate]

In Child Object(Incident) i have a field called Client ID(BMCServiceDesk__FKClient__c) this is a lookup field relates User .I need to populate Case owner field value in to Client ID. While creation ...
0
votes
1answer
92 views

How to query field from related record in sfdcDigest transformation in Einstein Analytics?

As title says,Is it possible to get field from a related record in sfdcDigest transformation in Einstein Analytics? I have looked at sfdcDigest transformation documentation and don't see anything ...
0
votes
1answer
372 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 ...
0
votes
2answers
390 views

Delete related records in trigger before delete

I have installed NPSP in my organisation. I also created a custom object named as "Opportunity Group(OppGroup__c)" that will group my opportunities. What I want is that during deletion of an "...
0
votes
0answers
163 views

Restrict Record Create to Custom Button Only

I would like to restrict the way my users can create a custom object record. Specifically, this object record is a child of a different object and should never be created without a reference to the ...
-2
votes
2answers
2k views

Lookup field goes on child or parent object?

Can someone give me a way to remember which object the lookup field and master-details fields go when creating a relationship? If I want to see custom object "c" in the contact object's related list, ...
4
votes
1answer
376 views

How to refer to an existing record in REST API composite JSON?

When using REST API composite JSON, how to refer with external id an existing record to existing Master-Detail parent from a newly created child We have the following objects: Organization__c: Has ...