Questions tagged [junction-object]

In Salesforce, a Junction Object is a custom object with two master-detail relationships to two different record types. It is used to represent a many-to-many relationship in which several junction objects can link one instance of a record to many children, and each child can equally be linked to many parents.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 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 ...
user avatar
1 vote
1 answer
67 views

Operating between two parents of a junction object

I have say object A, B and C with A and C as parent object and B as a junction object. What I want is- whenever a B is created between A and C, a field named field__c on A should be transferred to C ...
user avatar
0 votes
0 answers
42 views

Apex SOQL return partial result from junction object

I've built a quiz tool using Apex and Lightning Component. There's a many-to-many relationship between a Quiz_Session__c and a Question_Set__c. The junction object is Quiz_Question_Set__c From Apex, I'...
user avatar
  • 442
0 votes
0 answers
26 views

Trigger to create a 2nd record on Junction object after creating an initial record on a related Account

I have created a junction object (Account_Relation__c) to be able to link accounts to other accounts (many too many relationships). To do so, I made 2 lookup fields to accounts on the junction object. ...
user avatar
0 votes
1 answer
93 views

How to prevent redundancy in junction object? [closed]

I have 3 objects - Student, Course and Enrollment(Junction object for student and course). Student's fields - student number(text 80), student first name(text 25), student last name(text 25), no of ...
user avatar
0 votes
1 answer
422 views

Rollup summary field between multiple objects

I have 4 objects: Contact, Attendee, Events, and Event Category. I want to create a rollup field on the Contact object to count total number of Events (where event category = Training) attended by ...
user avatar
  • 97
4 votes
2 answers
565 views

How to avoid duplicate look up combination in many to many relationship?

I am trying to learn many to many relationships for salesforce objects, I was able to implement it using a junction object where there are two master-detail relationships. But it causes a duplicate ...
user avatar
0 votes
2 answers
231 views

Is there a standard way to add junction objects to a parent using the parent's default record edit form?

I have Cases objects in my Salesforce instance, along with Recommendation objects. For each case I would like to have multiple Recommendations. The Recommendations are not unique to the case, so the ...
user avatar
  • 1,151
0 votes
1 answer
24 views

SOQL Query for Account - Junction - Account

I need to join Account (type = person account) --> Junction Object --> Account (type = business account) We have person accounts enabled on our org. I can easily write what I need in SQL, but ...
user avatar
  • 1
1 vote
1 answer
90 views

URGENT - Related list should not display non accessible records

I have created a junction object[XYZ] with object ABC and Contact as masters. OWD for ABC and Contact is PRIVATE, no sharing rule for both objects. Profile level access does not have View All / Modify ...
user avatar
  • 159
0 votes
1 answer
53 views

Use case for parts and repairs

I have a use case that requires calculating "repair costs" on Maintenance Request Objects (I am calling it MR 2). The partname and partcost are fields in a Parts Object. There are about 100 ...
user avatar
  • 1
0 votes
1 answer
139 views

Add products on custom objects vs. junction object - please help!

My organization awards scholarships. I have two objects: scholarship and recipient. I need to be able to track the awards that each recipient receives, without creating a new record each time the same ...
user avatar
0 votes
1 answer
559 views

Update related list view

I have a custom object with a master-detail relationship to some standard objects through a junction object. On the related list view on the standard object, I would like to: Remove the checkboxes on ...
user avatar
0 votes
1 answer
224 views

Dealing with Name/Auto Number on Junction object records

I have a scenario where I am trying to be able to list multiple Tools that were used on a Job Site. I have two custom object records, Tools and Job Sites, and a third Junction object, called 'Tools ...
user avatar
0 votes
0 answers
205 views

How to import records of 2 parent objects and a junction object inbetween them using Data:Tree in SFDX?

I created some test data in a scratch org for a Trailhead project and i wanted to try to export it and then import it into my Devhub. I ran three different export queries and then created my own plan ....
user avatar
  • 33
1 vote
2 answers
298 views

Associate a Case with Multiple Locations

I need to give users the ability to create a case that's associated with multiple locations. There's currently a Master-Detail relationship between Account and Location. When a user is creating a case ...
user avatar
0 votes
2 answers
2k views

Using Junction object to display related list

Problem: I need to create a way to view two related fields on a given record between two different custom objects. I have looked up junction objects and it seems that this will be the best solution. ...
user avatar
  • 1
1 vote
2 answers
843 views

Can you create a 3 way many to many relationship between objects?

I want to create a custom object called Groups. I then want to create a M2M Relationship between Groups and Accounts. Then I want to Create a M2M relationship between Groups and Contacts. Is there a ...
user avatar
0 votes
1 answer
65 views

Changing junction object name

I have an existing junction object that is named poorly and is causing a lot of confusion. I wish to change the name of this object and move the changes to production. Can you please let me know ...
user avatar
-2 votes
1 answer
563 views

How to display contacts as they relate to accounts on a custom object [closed]

I am a newbie in salesforce I have a custom object say X which has master detail relationship with Account. Now I want to display the list of contacts related to account under the custom object X. ...
user avatar
  • 49
0 votes
1 answer
279 views

How can I map two queries from junction objects into an instance of a custom object class that I need to return?

I need my getUser method to return an instance of the custom object class UserCTI. I need make two queries and map their results into the UserCTI object, or I can make a subquery within the primary ...
user avatar
0 votes
0 answers
20 views

How can I return a Custom Object with a List of Parent Data from querying the Junction Object? [duplicate]

I am new to Apex trying to do some practice assignments and have gotten stuck on this junction object query. Task: Edit the current getUser() method to do the following: Return a custom object (that ...
user avatar
3 votes
0 answers
322 views

How to use sfdx force:data:tree:export to export CPQ Bundle Product for import into a new scratch org?

For starters I am trying to only export set of Products, Feature and Options that comprise a single bundle Product, but having problems because Product Option object has two lookup relationships to ...
user avatar
0 votes
1 answer
132 views

is it possible to get the parents old value in trigger update on junction object

i have a issue in retrieving the old value of parents record onthe junction object update scenario, do anyone have come across this scenario, please throw lights. Junction__c oldlrj = [SELECT Id, ...
user avatar
  • 333
0 votes
0 answers
89 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 ...
user avatar
0 votes
0 answers
198 views

Inserting record on Junction object with formula fields

I have Junction object called Agreement Scope which has two Master Detail relationships with Account and Agreement. We are assigning Account and Agreement in the lightning components Apex Controller ...
user avatar
  • 497
0 votes
2 answers
732 views

Filter records using junction object using SOQL query

I have a many to many relationship with 3 objects Position, Candidate, Job Application(Junction Object). I wanted to retrieve all the positions applied by a particular candidate and also the positions ...
user avatar
  • 79
-1 votes
1 answer
1k views

TRIGGER to update related records on Junction object

My scenario is One candidate can have a multiple Job application, custom objects are candidate__c(lookup to job application) Job_Openings__c(lookup to Job application) Job_Applications__c(junction ...
user avatar
0 votes
1 answer
74 views

Hide a Field in junction object

In Account Object, I have 2 different record type - type1 and type2. There is a Junction Object call Associated Location between Locations and Accounts and I want to hide a checkbox field in ...
user avatar
2 votes
2 answers
604 views

DML Insert List of Child Records and Junction Records in a single DML Statement

I've 3 Custom Objects (List) : List <C1> (Child) fields : Id, Name List <C2> (Child) fields : Id, Name List <C3> (Junction) fields : IdC1, IdC2, Name I was able to get C1 IDS ...
user avatar
  • 442
1 vote
1 answer
780 views

Upsert in junction records without duplicate creation

Have a junction object that is a many to many relationship between two obejcts - Account and Publisher. As mentioned in the documentation I set the key in the Is there an easy way to upsert junction ...
user avatar
1 vote
1 answer
459 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 ...
user avatar
  • 313
0 votes
0 answers
107 views

How to limit lookups in many-to-many relationship based on related record attributes?

I have created a many-to-many relation between Contact and Skill, a custom object that represents a contact's skills. A contact can be one of two different record types, Type A and Type B. I want to ...
user avatar
1 vote
2 answers
554 views

Querying to fetch data from junction object and Accounts

I have a junction object called "JIRA_Data" and its linked/ related to Accounts. How do I query to fetch data from this relationship. I am trying to extract id,type from Account object and Name from ...
user avatar
-2 votes
1 answer
355 views

How to get parent field values based on linked junction object

I have 3 objects. Platform and documents are parent and junction platform is child. Platform Junction platform Doc (junction object) documents I need all the documents linked to the platform. For ...
user avatar
  • 2,264
2 votes
1 answer
486 views

Incorrect Documentation - You can't create outbound messages for workflow rules on junction objects

In Workflow Considerations documentation, Workflow Limitations section, it has been specified that. You can't create outbound messages for workflow rules on junction objects. I have created a ...
user avatar
-1 votes
1 answer
387 views

Update Priority of Cases related to another Case through a Junction Object

We have a junction object called "Related_Development_Cases__c" that has 2 many-to-many relationships to the Case object through 2 Case lookup fields (Support_Case__c and Development_Case__c). We ...
user avatar
  • 73
0 votes
1 answer
360 views

How do I automatically update fields on a custom object with information from Events?

and thank you all for taking the time to read my question! Here's what we're trying to accomplish: Automatically populate a "parent" object, Project, with information from an Event used to schedule ...
user avatar
  • 1
0 votes
1 answer
1k views

Can a List View be made that filters on Junction Objects?

My organization associates Users with Contacts. We have a custom junction object to establish a many-to-many relationship between Users and Contacts. We want to allow Users to filter the Contact list ...
user avatar
1 vote
1 answer
446 views

Create related object of certain Record Type on Object [closed]

We are using the case object to different case type, due to that we have a lot of different record types. For a case it is possible to have a related Product this is done with a junction object. So ...
user avatar
-2 votes
1 answer
50 views

How to setup junction pointing 2x to contacts to delete child records when master is deleted?

The contacts in our SF instance can give gifts from other contacts or receive gifts from contacts. I need a way to represent who gave to whom and if a contact is deleted any record with the taker and ...
user avatar
  • 1,206
0 votes
1 answer
46 views

How to setup giver and receivers with junction object

The contacts in our SF instance can give gifts from other contacts or receive gifts from contacts. I need a way to represent who gave to whom. Would the following scenario work? Create an object "...
user avatar
  • 1,206
-2 votes
2 answers
1k views

How to implement Trigger on junction object to update field on contact

I have a junction object called contact_role__c between contact and a custom object called property__c. I need to update a field on contact object whenever a new property__c is created. This is what i ...
user avatar
0 votes
0 answers
475 views

Deleting junction objects

I have a use case where the Master object can only have one child object at a time, so when a user selects a new child object I need to delete the original junction object via Apex and create a new ...
user avatar
1 vote
1 answer
1k views

How to update contact object from related junction object?

I created a junction object called Sponsorship__c and have a many-to-many relationship. It is related to Contact through a master-detail relationship and I have another custom object called ...
user avatar
1 vote
1 answer
292 views

Junction Object between same SObject Type (b-directional siblings)

What is the best way to implement a Junction object that connects two of the same SObject Types? I have a data-structure that sort of represents a sibling relationship. Each Treatment__c has 0 or ...
user avatar
  • 9,416
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
user avatar
2 votes
0 answers
342 views

SOQL / Apex To Find Duplicates On A Junction Object ( OpportunityContactRole )

I have a rogue trigger that inserts duplicate OpportunityContactRoles when it shouldn't. I can't find the error in my code, but it's not a high-volume problem. It is, however, a daily low-volume ...
user avatar
  • 1,129
0 votes
2 answers
1k views

I cannot create child object to junction object

I have a junction object(JuncObj) with a custom object(ParentObj1) and contact as the masters. I've created a separate obj(NewChildObj) that is supposed to be a child object of JuncObj. When I create ...
user avatar
  • 485
1 vote
0 answers
36 views

External Junction Object Rearchitecture

Currently we have a junction object between a standard object and a custom object. Our SOQL queries are pretty straight forward for example SELECT Id, Date, Contact__r.FirstName, Contact__r.LastName,...
user avatar
  • 2,584