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
134 views

Don't See Contact Name field on Junction Object Related List

I have three objects: committee, committee member, and contact. Committee member is a junction object between committee and contact, with two master-detail relationships: one to committee and one to ...
Jeff's user avatar
  • 133
-1 votes
1 answer
239 views

Referencing junction object records on master object

On the Opportunity object I need to reference the industry sector of the Opportunity Contact Role junction object. One Opportunity has multiple Opportunity Contact Role relationships. If at least one ...
MarkB's user avatar
  • 27
0 votes
1 answer
52 views

Creating more than one new custom ('junction') object at a time

I have a created a custom 'junction' object, which contains custom fields that lookup a Campaign and an Installation Address. If possible, I would like to create more than a single instance of this ...
Daniel's user avatar
  • 1
2 votes
1 answer
76 views

Reducing loop runs and code repetition in a trigger where junction records are created which match several criteria

I'm new to Apex and coding in general and trying to get the best practices down where possible. This trigger challenge came from David Liu's Apex Academy series and gives the following requirements: ...
cwrcyn's user avatar
  • 21
0 votes
1 answer
386 views

Opportunity Contact Role - Report including record ID

My users need to create reports on Opportunities and Opportunity Contact Roles that would include the Opportunity Contact Role ID. Supposedly because this is a junction object, the record ID field can'...
MarkB's user avatar
  • 27
0 votes
1 answer
232 views

Cross Object Formula to prevent record creation on related custom object

I have a requirement as follows: If a Member has been removed from a Volunteer Project for attendance issues, they can never be added to another Volunteer Project. The Member Object is actually the ...
Drew's user avatar
  • 11
0 votes
0 answers
344 views

Using a junction object relationship as criteria for a flow

I have a requirement to run an automatic accounts payable flow that requires a public group to enroll an account (we have 89 public groups) An example would be Public group A has Invoice Z with ...
JesseHollett's user avatar
0 votes
0 answers
32 views

Check for duplicates on Junction Object [duplicate]

I have a new custom object that I want to prevent duplicate records from being saved in. It is a junction object with two master/detail lookup relationship fields. A "duplicate" in my case ...
Craig Rowland's user avatar
0 votes
1 answer
294 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 ...
sfuser001's user avatar
1 vote
1 answer
283 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 ...
Ashutosh Srivastava's user avatar
0 votes
0 answers
84 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'...
Bryce's user avatar
  • 442
0 votes
1 answer
175 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 ...
Mit Desai's user avatar
0 votes
1 answer
981 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 ...
Hari Ha's user avatar
  • 127
4 votes
2 answers
992 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 ...
adnan_aust's user avatar
0 votes
2 answers
497 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 ...
Andy Ray's user avatar
  • 1,359
0 votes
1 answer
117 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 ...
cdog's user avatar
  • 1
1 vote
1 answer
198 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 ...
Tiny's user avatar
  • 159
0 votes
1 answer
79 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 ...
user28's user avatar
  • 1
0 votes
1 answer
463 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 ...
patriciajlim's user avatar
0 votes
1 answer
911 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 ...
GalacicAdmin's user avatar
0 votes
1 answer
422 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 ...
PeterVJ's user avatar
0 votes
0 answers
318 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 ....
George's user avatar
  • 33
1 vote
2 answers
528 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 ...
Laura Bejjani's user avatar
0 votes
2 answers
3k 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. ...
Leah G's user avatar
  • 1
1 vote
2 answers
1k 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 ...
user76956's user avatar
0 votes
1 answer
132 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 ...
Spiderman's user avatar
-2 votes
1 answer
1k 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. ...
teeshu's user avatar
  • 69
0 votes
1 answer
442 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 ...
Patrick Shea's 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 ...
Patrick Shea's user avatar
3 votes
0 answers
439 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 ...
George Kibliov's user avatar
1 vote
1 answer
332 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, ...
user8132's user avatar
  • 343
0 votes
0 answers
136 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 ...
Manjunath's user avatar
0 votes
0 answers
281 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 ...
mvk1991's user avatar
  • 525
0 votes
2 answers
2k 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 ...
Saloni's 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 ...
My xidoa's user avatar
0 votes
1 answer
131 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 ...
user7697691's user avatar
2 votes
2 answers
855 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 ...
Bryce's user avatar
  • 442
2 votes
1 answer
1k 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 ...
user275157's user avatar
1 vote
1 answer
535 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 ...
ekiim's user avatar
  • 323
0 votes
0 answers
138 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 ...
Swisher Sweet's user avatar
1 vote
2 answers
742 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 ...
dark horse's user avatar
-2 votes
1 answer
701 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 ...
Annappa's user avatar
  • 2,312
2 votes
1 answer
595 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 ...
Santanu Boral's user avatar
-1 votes
1 answer
654 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 ...
Brandon's user avatar
  • 63
0 votes
1 answer
457 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 ...
derek's 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 ...
Nathan Hinchey's user avatar
1 vote
1 answer
602 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 ...
ChristianJuul's user avatar
-2 votes
1 answer
56 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 ...
Apex N-u-b's user avatar
  • 1,278
0 votes
1 answer
59 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 "...
Apex N-u-b's user avatar
  • 1,278
-2 votes
2 answers
2k 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 ...
Mohit Joshi's user avatar