Questions tagged [relationships]
Use relationships to associate an object with other objects in Salesforce.
542
questions
0
votes
0
answers
810
views
Related list for Indirect Lookup Relationship is not showing records
The child record looks up to its parent via an Indirect Lookup Relationship through an external Id field. I have written code that inserts the child against the parent. The child record is getting ...
1
vote
2
answers
2k
views
How to create a Contact associated with an Account by external ID?
I'm trying to create a Contact trough a REST API. I want it to be linked with an Account. At this point I don't know the AccountId, however, I do know a value of ext_id__c which is a custom field ...
1
vote
1
answer
261
views
How to do aggregate functions in master detail relationship
I have 2 objects student and course ..I want to calculate total number of students for particular course I have to find.
Count of students in each course
Student’s maximum fee in course
Minimum fee ...
1
vote
1
answer
1k
views
Query or delete assets when there's relationship with cases
Cases can be related to assets- there's a list of cases with an asset. But there's no relationship - both on case and asset there's no lookup or master field! Even more, when I change account related ...
0
votes
1
answer
197
views
Linking a custom Object's field to a Custom Setting's field?
I was trying to get a custom object's field 'Report' to auto-populate by linking to a field in Custom Settings, 'Id'. Is there a way to do this using a look-up relationship? Or maybe there is another ...
0
votes
2
answers
60
views
Do I use the existing Accounts object or create my own
I have a requirement for:
1) A Many-to-many relationship requirement between Accounts and Contacts which will utilize a junction object.
2) There will be a One-to-Many relationship between the ...
1
vote
0
answers
247
views
Obsolete Report in salesforce due to relationships change from Lookup to Master Details
I changed relationship from Lookup to Master Details. Now reports are obsolete.
There is no option to change Master Details to Lookup. Is there any option to get those reports back?
Other than ...
0
votes
1
answer
2k
views
Field is not writeable: CAM_Members__c.Affiliate_State__c
My compiler says that this field is not writeable:
Field is not writeable: CAM_Members__c.Affiliate_State__c
I have this class
static testMethod void AffliateTest(){
SS_Data__c ns = new ...
0
votes
1
answer
74
views
Relationship question?
A company has a custom object named Warehouse. Each Warehouse record has a distinct record owner, and is related to a parent Account in Salesforce. Which kind of relationship would a developer use to ...
2
votes
0
answers
143
views
Return all documents for record on public site
I have a public site where I pass a record id via URL parameter. I show the related list of the files. I can do this when I preview the site from the developer console. But when I do this from the "...
4
votes
2
answers
4k
views
How to use GetSObject to retrieve related data in a null safe manner?
I have a lookup relationship.
If I just do the following query it works fine:
Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId];
system.debug('c:' + c);
However with ...
0
votes
1
answer
651
views
Formula field Not working as expected
I have Formula field called "Active" with output type as Checkbox on Contracts object.
There is checkbox field on Account object and the field name "Credit Hold". This credit hold field is used to ...
0
votes
1
answer
738
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 ...
0
votes
1
answer
5k
views
Fill lookupfield in Testclass
I have the following code with a trigger which gives me the error:
FLOW_ELEMENT_ERROR The flow failed to access the value for
myVariable_current.Product__r.ProductId__c because it hasn't been set
...
0
votes
1
answer
470
views
What is better - self relationship or custom object?
I need to relate Opportunities to other Opportunities. What is the best way to go about this?
Lookup to itself?
Create a custom object for a many to many relationship between Opps?
Eg a potential ...
9
votes
1
answer
3k
views
How to initialize sObject with Relational fields?
In Lightning component we have relational fields (e.g. CustObjA.CustObj__r.Name) which we use in lighthing component. This is on component as,
<ui:inputText class="slds-input" value="{!v.Item....
1
vote
2
answers
572
views
Invalid foreign key relationship error when referring to Task object related lookup record
I am totally new at this and this actually one of my first triggers so I'm really proud that it is working (when used on a Case__c object) but it is not working when triggered on any other object. I'm ...
4
votes
2
answers
489
views
Reading and writing child relationships of not-yet persisted SObjects?
I have a Parent__c and Child__c custom object connected by a lkp_Parent__c field. I now create an in-memory version (no insert) of a parent-child tree
Parent__c p = new Parent__c();
Child__c c = new ...
0
votes
0
answers
21
views
Establishing relationships automatically
I have a record with a code field and I have custom metadata which maps from code to textual description. I would like my users to be able to see in the layouts and reports not only the code but the ...
3
votes
3
answers
4k
views
Can I export related fields using a data loader?
I want to be able to export the related account fields for each quotation in Salesforce using Data Loader. I suspect this is possible using relationships (Object__r.FieldName__c), but I'm not 100% ...
-1
votes
4
answers
3k
views
I need a trigger to update all child object records of parent object
I have a custom object called child_object__c with a lookup into Parent_Object__c records. When Parent_Object__c Type field value Primary to Secondary is changed, I need to field update all the ...
1
vote
2
answers
2k
views
updating the child record and linking it to parent
I have scnerio where I am loading the child record from an external system and I want to connect it with the parent record. But I do not have the sfdc id
of the parent record that I can put in the ...
0
votes
1
answer
364
views
Relationships for data extensions in Journey Builder and Filtering
1.) Relationships for data extensions that are configured in the contact framework within the contact builder are only applicable for consumption within the journey builder.
2.) If you intend to ...
0
votes
2
answers
12k
views
Form JSON structure and add values of all child record of a parent object
I have to populate the values in a JSON structure. The values are obtained from the fields of a parent object and also the child object. I may have more
than 1 child records of a parent object. how ...
0
votes
1
answer
912
views
How to get child record type Name in SOQL [duplicate]
I am trying to query and get the record type of the child record of a Parent record.
I amusing the below code but I in the result of record name I get [Object Object] only. Why does the name of the ...
8
votes
2
answers
18k
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 ...
1
vote
1
answer
46
views
I want to cpy date between parent and child object
I have an object called Opener__c. And I have a second object called Underwriting__c. In Underwriting__c object I have a lookup field Account__c which is a relationship to the Opener__c object. When I'...
2
votes
1
answer
1k
views
Relationship using Visualforce and StandardController
Is there a way to get related records using something like {!Account.Contacts} in a VF page with Custom Objects? Does the type of relationship matter? If I have a custom object and it has a look up ...
1
vote
1
answer
781
views
createdbyid lookup field reference, is it possible?
I am trying to setup a lookup relationshiop for createdbyid as I have done for contact and account , as I am loading in migration data
for example for a custom object field i have called ...
6
votes
1
answer
628
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 ...
10
votes
3
answers
892
views
Which is faster between static and dynamic getSObjects?
What is the difference in execution between . (dot) notation and getSObjects method? Omitting of course that I can parametrize with string getSObjects method.
for example:
Account....
1
vote
1
answer
541
views
Regarding Many-to-Many Relationships on Salesforce Docs
There is one query. On Salesforce Docs, you have defined Many to Many relationship between Candidates and Positions Objects using Job Application Object which is not a JUNCTION OBJECT. ( One candidate ...
0
votes
1
answer
300
views
Multi join filters
I would like to run a filter that involves data from more than one data extension.
Eg. I have three Data Extensions A, B, C and I would like to filter A by an attribute of C but A and C have not ...
0
votes
0
answers
307
views
How to manage sharing rules in apex?
I am currently learning Salesforce. And I`ve got the task on courses about apex managed sharing rules. I need to use 3 standard objects - Account, Contact, User and 3 custom - Terr(as a territory), ...
1
vote
2
answers
2k
views
What is security access for child record when master is private
There is one junction object in which one master object has owd public access and one master object has private access
0
votes
1
answer
84
views
Assign a related item (Such as Contact) Via REST / APEX Class
I am attempting to build an integration between Salesforce and an external system.
I am NOT a Salesforce administrator, but rather the developer / administrator of the system I'm attempting to ...
1
vote
3
answers
7k
views
How can I associate multiple accounts to a single opportunity?
We are a company who sells to both individual companies (One opportunity to one account) and to companies with branch offices (One opportunity with multiple accounts). Is there a way to associate a ...
0
votes
1
answer
317
views
Standard Object Permissions
If a standard object has only read access, then does it mean it a user can access all child object records related to standard object?
Example: If I give read access to order object for a user, then ...
5
votes
4
answers
19k
views
Accessing the parent sObject from the child sObject?
I have Object1__c and Object2__c which are related by a master-detail relationship (Object1__c is the master).
I want to be able to query a record of Object2__c in such a way that I have access to ...
0
votes
1
answer
736
views
Cannot delete a data relationship in Marketing Cloud
I have set up a couple of data relationships in Salesforce Marketing cloud. I later removed the underlying data extensions and now it is not possible to remove the original data relationships. The ...
0
votes
0
answers
179
views
Query not returning data on UI
I have a lookup field on Contacts (say Customer__c). A REST API call is being used to display data on page (we are using angular for displaying UI and Salesforce is maintaining database). This API ...
3
votes
0
answers
29
views
Can I manage suppliers SLA's by using entitlements?
are there any use cases to demonstrate if it makes sense to manage my suppliers by using entitlements as a way to manage their SLA's, e.g., specifying agreed services, review periods, logging issues ...
1
vote
0
answers
57
views
Related object not auto-filling parent object field
I have a custom object(Warranty Contract) with 2 related lists(Warranty Assets, Maintenance Contract).
When I am in the warranty contract, If i click on New Warranty asset on the related list, the ...
5
votes
1
answer
11k
views
INVALID_FIELD, Foreign key external ID not found - Inserting Related Records via External Id
I am trying to insert related records via an External Id. i am using an approach described here where we create an empty parent object with the same external Id like the "real" parent. It is a self-...
1
vote
0
answers
477
views
Child to Parent Relationship Null Managed Package
My attempt to query a Child to Parent relationship ('__r') within a managed package is returning null. I've inserted the objects as below:
ns__Parent__c parent = new ns__Parent__c(ns__First_Name__c='...
0
votes
1
answer
994
views
Need to retrieved all related object of Opportunity object [duplicate]
I am able to get all objects which are related in opportunity object by looking into opp-->Fields.I can see related object lookup(Object name).but how can i know other objects which are using ...
1
vote
2
answers
100
views
View object's custom relationships?
I'm hitting a "Custom Relationship Limit Exceeded" error on the Account object, but I'm not really sure how to identify the existing relationships so that I can clean them up.
For example, I pulled ...
2
votes
1
answer
263
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
1
answer
573
views
Getting the records between objects which does not have relation
We already knew that Account and Contact have relationship where as Account is parent. I created one more child for Account called RelateObj. But there is no any relation between RelateObj and Contact....
0
votes
1
answer
104
views
Unable to get records from multiparent object
I am unable to get records from objects which has relationship like the following.
We already knew that Account and contact have relationship where as Account is parent. I created a child for contact ...