Skip to main content

#Junction Object0 discussing

Is it possible to push or pull data from a child object to a parent object? #Data Model    #Junction Object 

Use Case: I have a custom object that needs data from the other parent object.  Can I use a formula field on the custom object to capture the data from the other parent object? 

0/9000

Hi all, 

 

I'm creating a process builder on a junction object and I'm having some difficulty. There are three objects in play: Contact, Committee Enrollment (junction object) and Committee. I am trying to create a process builder on the Committee Enrollment object that when someone is enrolled in a certain committee, a boolean field on the contact record updates to true. I have tried it out in my Sandbox and it worked perfectly. When I tried it in production, it did not work. 

 

I have tried: 

-Spell checking the committee names

-changing field permissions to full access

-refreshing the screen

-deleting the process builder and recreating

 

When I recreated the process builder, I no longer see the boolean field I need to update in the "select a record related to the Committee_Enrollment__c" part for the immediate actions. I tried selecting just the contact object and not a specific field, but it will not let me move forward without selecting a specific field. 

 

I'm stumped--what should I do? #Automation #Process Builder #Junction Object

3 answers
  1. Oct 26, 2021, 4:21 PM

    Hi @Eric Praud

     

    yes, the field security level is all good to go (that's what I meant by "field permissions are at full access"). I can read and edit it, yes. Thanks! 

0/9000

We have a custom object for projects. We'd like to relate multiple records from the same object on a record, potentially several times. For example, we would like NPI project records to be related to any of the other record types within the FWM Project object AND have it be connected within those record types (picture).

 

Within the same object, how do I attach multiple records on the same object to 1 record?

 

When we did this between objects, we used the Junction Object feature. However, because these records are all on the same object, we cannot do that.

Any ideas?#

 

#Related Record  #Junction Object  #Salesforce Integrations  #Sales Cloud

3 answers
  1. Tom Bassett (Vera Solutions) Forum Ambassador
    Sep 17, 2021, 7:43 PM

    Hello,

     

    You could create a Object to hold these relationships eg. NPI Projects Relations.

     

    As you can't have two master-detail relationships on one object both looking up to the same object you could instead use on master-detail and another required lookup field.

     

    Alternatively you could use two lookup fields.

     

    This is like creating a Junction Object but without two master-detail relationships.

     

    Thanks, Tom

0/9000

Hi all,

I am not yet sure if this is possible at all.

We have a checkbox on AccountContactRelation saying a Contact is main contact on a specific account. We've got the requirement to pick up the given information from AccountContactRelation and put it on the Contact object. 

 

I don't think this is possible. I have these thoughts:

 

  • AccountContactRelation says that a Contact can be associated with more than one account. So, it can be the main contact of one of these accounts the Contact is associated with, but
  • It can also be the main contact in more than one account? (I am wondering if this assumption is correct)
  • On Contact you have the lookup Account (Account Name) saying this is its primary Account, so, I think it wouldn't work if you just want to fill out the checkbox on the Contact object automatically saying it is a main contact if the same Contact is a main Contact on an AccountContactRelation record

I am just thinking if the implementation of such requirement would make sense or not.

 

What do you think?

 

#Junction Object  #Sales Cloud  #Service Cloud  #Nonprofit  #Trailhead  #Automation  #Integration

1 answer
  1. Sep 15, 2021, 9:38 AM

    Hey Laura,  

     

    I'm not sure I understand the rationale behind your requirement, I'm assuming that users would like to know on an Account Record Page which is the primary Contact. 

     

    When we use Contacts to Multiple Accounts, there are two types of relationships between an Account and a Contact. A direct relationship is one where the Contact is associated to an Account via the Account lookup field on their Contact record. An indirect relationship is one where a Contact is related to an Account via the Account/Contact Relationship object.   When you enable Contacts to Multiple Accounts, every Contact then has both a direct and indirect relationship with their primary Account, as they are linked via both the Account lookup and an ACR record. However, only a single Primary Account can exist.  

     

    For the requirement that you're describing, you have a few options that you could consider.  The first is you could customise the values in the Role field on the Account/Contact Relationship object, adding the value 'Primary', so that when users view the Related Contacts list on the Account page, they can clearly see which Contact is the Primary.   A second that doesn't require configuration is the Account/Contact Relationship object has a checkbox field isDirect, which shows whether the ACR record is linking the Contact and its Primary Account, which could be a shortcut method. Alternatively, in Lightning when you use both the 'Contacts' related list and 'Related Contacts' related list on an Account record, only the direct Contacts will show in the Contacts list, which is also a good indicator of which individuals the team should be talking to. This is an OOTB version of your custom checkbox that should meet your stated requirement.   

     

    I hope this helps, below are some links to the Help documentation for items I have mentioned above: 

    Cheers,  Matt

0/9000

Hi All,

 

In my Org we have Object A and Object B linked through a Junction Object.

 

There is a business Requirement now to create another Junction Object and link the Child Records of Object B to Object A separately.

 

I am really struggling to come up with a way to do this via Data loader.

 

I attempted to do through a Scheduled flow but i am getting a this error when the flow runs UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or 146 records.

 

I have no development experience to do through Apex so i am wondering has anyone any advise.

 Thanks 

Stephen

 

#Dataloader.io  #Data Management  #Junction Object  #Sales Cloud

2 answers
0/9000

In our sales, we often have several stakeholders involved in the closing of an opportunity. Even though there is technically just one customer. We often need to engage with several different accounts to progress a deal forward. As such, it is important to track what accounts are stakeholders of each opportunity.      A given account can be a stakeholder to many opportunities and a given opportunity can have many stakeholders. Thus we set up a junction account to link Accounts and Opportunities to represent the stakeholder relationship. So we will use the normal Account - Opportunity relationship to represent the customer and the junciton relationship for stakeholders.      We also track tasks at the Opportunity level. For any given "Stakeholder" Account, we want to see all the activities associated with Opportunities for which it is a stakeholder.       For example, lets say Account A is a stakeholder for Opportunity X, Opportuity Y, and Opportunity Z and each of those opportunities have 5 tasks Related To them. We want to see all 15 tasks shown in one place.       We have tried dozens of iterations of reports and we can show the Account - Opportunitiy relationship and the Opportunity - Activity relationships, but can't connect them together. We don't even need it to be a report, any way we can show them all together would be useful. Any help is greatly appreciated.

 

#Reports & Dashboards  #Junction Object  #Activities  #Opportunities  #Accounts

2 answers
  1. Vuk Stajic (MVRK Inc.) Forum Ambassador
    Jul 27, 2021, 11:50 AM

    A more simple approach - and perhaps you tried this and it did not work for you - would be to use the standard Opportunity Contact Roles feature for all involved Contacts regardless of Account.

     

    And to have a Contact Role or Roles that define those individual's responsibility/task/relation to the opportunity.

     

    Then you have a single list of who is involved in what opportunity, even though they may not be contacts of the Account related to the Opportunity.

     

    And, you can set all tasks in the single Opportunity record even if they are call notes or meetings etc with contacts not a part of the Opportunity Account.

     

    More reading on Contact Roles: https://help.salesforce.com/articleView?id=sf.contactroles.htm&type=5

     

    At a company I worked at I would sell services to an account, but would have 1 or 2 or more partner organizations selling products to the same account at the same time.

     

    In my opportunity I would track all of the Contacts from my client involved, but also track the other Account Execs and Solution Engineers and VPs etc of my partners involved in that Opp.

     

    Happy to chat more about it if needed :)

0/9000

I'm trying to create a junction object, but I'm getting an error message that doesn't make sense. I created a custom object called Projects. I also created a custom object called Project Products. The first field I created on the Project Products object was "Project", which I designated Master-Detail. I tried to create a second field, also Master-Detail, with a relationship to Products (big surprise, right?). But "Products" wasn't available in the "Related To" list. So I went back and tried making it a Lookup Relationship. But after I click "save" on the last screen, I get this error message: 

 

Cannot Create Master-Detail Relationship You cannot create a new Master-Detail relationship on an existing custom object if records already exist. You must first create a Lookup relationship, populate the lookup field with data in all records, and then change the relationship type to Master-Detail.

 

So, two things: 

1. There are no records yet for Project Products. Nothing has been created. 

2. I am TRYING to create a Lookup relationship and it won't let me. 

 

Even if I go back and change the Project field from Master-Detail to Lookup and try again, I STILL get this same message. Anyone have any ideas on what's going on? Any thoughts or advice would be appreciated. 

 

Thanks!

 

#Junction Object  #Sales Cloud

8 answers
  1. Jul 8, 2021, 5:15 PM

    RESOLVED!

     

    I want to post here how I got it working in case anyone else runs into the same issue and stumbles across this post. 

     

    I noticed in Dinesh's screen shot that he was in SF Classic. So I went into Setup that way. I still couldn't get the Lookup relationship to work, but I did notice that for some reason, the custom object I had created for Project wasn't listed as "Deployed". (I have no idea how that happened, as the second custom object I had created, Project Product was deployed.) So anyway, I changed the setting on Project to deployed while in Classic mode, then went back into Lightning and tried creating the Lookup relationship between Project Product and Product and Voila! This time it worked!

     

    The other thing I can't figure out is if Project wasn't deployed, how was I able to create a Master-Detail relationship between Project Product and Product? That doesn't make sense to me. 

0/9000

We have a junction object called Pilot/Policy Relationships and would like our customer experience users to view the related records that is attached to their Policy.

 

The customer has Read and Create access to the Parent Object, Policy and the other object Pilot. As well as the junction object Pilot/Policy Relationships. But it still not displaying in the experience...

 

Looks like any junction object records are not displaying for the users. But the related records that are related to the Policy object directly are visible...

 

Junction object records not showing in Customer Experience

 

#Experience Cloud  #Junction Object  #Related List  #Sales Cloud  #Service Cloud

2 answers
  1. Jun 28, 2021, 4:41 PM

    What is the OWD sharing settings for the Pilot/Policy Relationships object?

0/9000

I have created a junction object to establish a many-to-many relationship between 2 objects. One is a customized "role" multi-picklist in Contacts, the other is the "program name" in the custom Program object. A contact can have different (multiple) roles depending on what program the contact is related to and the contact can be related to several programs at the same time. For example, the contact can be a "contract partner" and a "research partner" for program A and, at the same time, a "collaborator" for program B. This junction "relationship" object worked in theory - the problem is that capturing these different relationships is extremely important to us, so I would need to have users identify this relationship every time they create or edit a contact, which means I need this info to be completed on the Details page of Contacts and make it a required field. However, I can only add a new relationship in the related list on the related page and thus can't make this a required field. When I create a lookup field to the relationship on the Details page of Contacts and make it required, I run into obvious issues if the contact is a completely new contact (as the contact has not been saved at that stage, so doesn't exist in the system, yet the relationship lookup field is trying to find it to reference it so it can create the requested related relationship). Any help with this would be much appreciated.

 

#Junction Object

1 answer
  1. Jun 21, 2021, 9:29 PM

    Hi Abie,

     

    As you said, creating a junction record requires that a record exists in both Master objetcs.

    Therefore, you cannot create a master object record and its junction record at the same time, at least manually. This is not simply related to Salesforce design, but to database logic.

     

    What you could do however is create a flow that triggers at master record creation, after the record is saved, in order to create your junction record with your custom logic.

    From a user perspective, the master record and its junction record would be created at the same time.

     

    Best regards

    Guillaume

0/9000

Can someone point me in the direction of how to create a DLRS when the child object is part of a junction object?

2 comments
  1. May 18, 2021, 4:17 PM
    When it comes to Junctions make sure the fields you reference are indexed and that you dont run into SOQL limits like 50k records returned and so forth.
0/9000