Skip to main content

Questions tagged [relationships]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

How to import parent object field in lightning record form of child custom object?

There is Contact object as parent object and I have created a custom object called Vaccination_Information__c which is a child of Contact object. I want to include the contact name field from Contact ...
0 votes
1 answer
28 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
0 answers
31 views

MC Connector - how does it understand the relationship type when synchronizing objects?

I have noticed something weird today, which made me a little confused about how the connector actually works. 2 BUs, 1 Service Cloud Org, multi-org connector installed. There are two different ...
1 vote
2 answers
1k views

Inserting an object with not writable field

I've this class that I need to test it: public class A800ExpiredClientReportV2 { Public ID quotID {get;set;} Public List<Quotation__c> quotList {set;get;} Public ...
8 votes
2 answers
28k views

Is it possible to convert a Master-Detail relationship to a Lookup?

I'm going through the Trailhead training (here), and see the following two snippets which seem to disagree: "It’s possible to change a lookup relationship to a master-detail relationship, but not ...
0 votes
1 answer
1k 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 ...
6 votes
2 answers
1k views

Is possible to relate Data Categories to custom objects records?

I have some data in Knowledge and Answers that I'd love to relate to other data in custom objects? Is it possible to refer data categories from custom objects, besides sort of manually (and ...
1 vote
3 answers
10k views

Best way to query child, grandchild from parent

What is best way to display child, grandchild from parent or more than 1 level SOQL down. I tried to display grandchild of a parent record. Any reference would be great. Thanks
0 votes
1 answer
5k views

Foreign key external ID: not found for field in entity Account

When trying to upsert contacts and relate the Contact to Account using an external ID on Account I am getting the following error Foreign key external ID: ABC12 not found for field DBExt_ID__c in ...
0 votes
1 answer
55 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", &...
0 votes
0 answers
46 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='/<...
3 votes
1 answer
70 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 vote
1 answer
772 views

How to retrieve data from Junction object for indirectly related object

Below I'm trying to explain how the objects are linked to each other and what needs to fetch from an indirectly related object. I want to update a field on Order object based on the value of a field ...
2 votes
1 answer
279 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()); } ...
4 votes
3 answers
4k views

Multiple Many To Many Relationships on same Custom Object

Forgive me, I just started Salesforce development this week so I don't know many of it's methodologies and idiosyncrasies yet. Let's say I need a Custom Object to represent computer parts ...
-1 votes
1 answer
38 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
42 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='...
0 votes
0 answers
74 views

Operating on summarized values in a matrixed report

Hello fellow Trailblazers I'm in a bit of a pickle here I have two tables referring to buys of gas and gas sales to customers. Each table has the same fields (date, price/liter and quantity in liters) ...
1 vote
1 answer
384 views

How many LookUp and Master Detail Relationships we can create on a single object?

I have came through various articles saying that we create 25 or 40 Lookup relationships on an object but in my org it is showing relationship limit as 50.Can anyone confirm the right number?
8 votes
1 answer
9k views

SOQL: Comparing two custom relationship fields in a nested query

I think I may be hitting some sort of SOQL limitation in the WHERE clause. I am trying to return fields from two parent objects, after comparing two date fields on both Objects. The goal is to have a ...
1 vote
3 answers
401 views

Query Lookup Relationship With SOQL Not Working

I have a SalesForce custom object named Loan__c which has a Lookup field called LoanLead__c and I'm trying to query that relationship with SOQL but I'm getting an error when I run the query SELECT Id, ...
0 votes
1 answer
482 views

Run trigger for an object when related objects update

Given this example trigger on the SBQQ__Quote__c object, I can log data whenever the quote is created/updated/deleted/undeleted. trigger QuoteTrigger on SBQQ__Quote__c (after insert, after update, ...
0 votes
1 answer
152 views

unable to remove Related Contact from Financial Services Cloud Relationship Map Edit

We have a business requirement asking why the related contacts are not removable from the list within the Relationship Map Edit page. In the screen shot the related contacts are greyed out. I'm not ...
0 votes
2 answers
410 views

List of group members and their `IsActive` status

Is it possible to retrieve all users that belong to a certain group, along with the value of each user's IsActive field? Required output: GroupId Id IsActive A001 001 true A001 002 false A001 003 ...
0 votes
1 answer
174 views

Query a Min Value of a Related field to a Child Object from Parent and Assign it to a new record

I am trying to find a minimum value of the field Maintenance_Cycle__c (which is a field on the Product standard object which is looked up by the Equipment_Maintenance_Item__c custom object, which is ...
0 votes
2 answers
8k 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 ...
1 vote
0 answers
544 views

OpportunityLineItem does not have a lookup field to PricebookEntry. Am I missing something?

Apologies in advance if this is a stupid question. Based on what I've seen in the documentation and various forum post answers, I believe the following relationships between Salesforce standard ...
0 votes
1 answer
3k 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
1 answer
198 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
1 answer
322 views

Sending Adobe agreements on custom object relationship error

I have created a custom send for signature button for a specific Adobe Agreement in Salesforce lightning using the following: {!URLFOR('/apex/echosign_dev1__AgreementTemplateProcess', null, [masterId =...
-1 votes
1 answer
76 views

Contact to contacts

I'd like to be able to relate a contact to multiple contacts. For example, John is a student, and I want him linked with Teacher A and Teacher B, etc. I created a custom object "Teachers" ...
0 votes
1 answer
389 views

How to write a SOQL Query in Apex to Fetch the minimum amount of all the related opportunities for an account

I have an account which has related opportunities. For those opportunities I wish to get the minimum amount through a SOQL Query. How can I achieve this if I need to use only 1 SOQL Statement in Apex? ...
1 vote
1 answer
736 views

Filter for lookup on object in many-to-many relationship

I have two custom objects - A and B, which have many-to-many relationship, presented by a third custom object - A_B_Asoc. A ------> A_B_Asoc <------ B In Opportunity, I have a lookup to A, ...
2 votes
2 answers
185 views

sObject type 'Store' is not supported

I am new to Salesforce and currently trying to query the fields from the Store object related to the OrderSummary standard object. Store has a lookup relationship with OrderSummary object. First, I ...
1 vote
1 answer
581 views

SOQL Syntax to Return Opportunity Data via Account Object

I'm trying to write SOQL to access fields from both the Account and Opportunity objects from the Account object. Specifically I'm trying to retrieve the Id and Name fields from Account while also ...
-1 votes
1 answer
491 views

I want to link expense(custom object ) entries with Activity object[Possible duplicate but need workarounds]

Business requirement is to link existing custom object(Expense) to Activity(Task/Event). So that they can leverage capabilities of Activity object and link all expenses to an activity. As per ...
3 votes
0 answers
2k views

Is there a way or workaround to relate Tasks to parent-Tasks or Tasks to Events?

I know this is an old limitation and we've worked around it by creating simply a plain text field holding the parent activity Id together with custom components (visualforce or lightning, both work) ...
0 votes
1 answer
1k 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 ...
4 votes
2 answers
497 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 ...
3 votes
3 answers
995 views

SOQL for Winter 20 Where is this used functionality

Hi I would like to know how I can query the "Where is this used" relationship via SOQL. Generally, Metadata information on Fields can be found in FieldDefinition and Entity Particle tables, but can ...
0 votes
1 answer
294 views

How to insert a record and input values from the master/parent information

I have a custom object named "Property Booking" where if the status changed to approved I have to create a record for my "Quotation" custom object. The tricky part here for me is I ...
0 votes
1 answer
222 views

Use field as relationship connection between objects

I am struggling with a seemingly easy task: I need to connect Account Objects with a custom object created for reviews. One Account can receive multiple reviews and they should be shown in the account ...
0 votes
1 answer
274 views

How do I put Salesforce child details into tabs?

My question actually comprises of two sections. I have two objects namely cases and reviews. Firstly, I want to build a one-to-one relationship between cases and reviews where cases is the parent and ...
5 votes
6 answers
37k views

How many master-detail relationships per object?

All I see online is that each object can have 2 master-detail relationships, but on the Salesforce App Limits PDF : https://na5.salesforce.com/help/pdfs/en/salesforce_app_limits_cheatsheet.pdf It ...
0 votes
1 answer
304 views

SOQL Query for updating related records

I have two Objects: Opportunity and Bid(custom Object). A bid is having a lookup field to opportunity i.e. an opp. can have multiple bids. I need to update the comment field of Bid records, but the ...
0 votes
0 answers
2k views

Record trigger flow not working for case and email message object

I have working to convert the workflows into flow for the below scenario with Case and email message objects. But its does not triggering properly and am not get the result. Am not sure where the ...
-1 votes
1 answer
1k views

How to relate two accounts?

My scenario that i want to achieve is to relate two accounts via a relation ship: I'm on an account, and I have to have a related list wich is "Account relationship" In this related list : ...
4 votes
1 answer
964 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
386 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
582 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 ...

1
2 3 4 5
11