function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shannon FosterShannon Foster 

Link Parent to Parent with same phone number trigger to display in Related List

We currently use opportunities (renamed service contracts) to record our customers and the Gas contract that they have agreed to with us. However, when a different vendor submits a new contract for that same customer we create a new service contract. We want a way to have any service contract with the same phone number show in a related list view on each service contract. Additionally, we are beginning to sell a new product and have created a new object. (Electric Service Contracts) We want these customers who have the same phone numbers to show up in another related list view section on the service contract and vice versa on the electric service contract. So that both the gas service contracts and electric service contracts will have gas and electric contracts with the same phone numbers listed in two separate sections on each. Salesforce has recommended creating a trigger to accomplish this but I am a little lost on exactly what I need to do from here. I can link them together using a lookup field but this allows me to only link one account. Any assistance in much appreciated! -Update: I have since talked to Salesforce and they have informed that it is not possible to link Parent to Parent. 
rajat Maheshwari 6rajat Maheshwari 6

Hi Shannon,

As per your requirement, Below is my understanding, please confirm the same:  -

1. One contract(Gas contract or Electric contract) can have multiple customer with same phone number.

2. When New service contract will create with phone number as another service contract exist with the same phone number, then automatically those new service contract will associate to existing service contract. Same will be happen in case of Electric contracts.

Please let us know the same. You can contact with me on email as well.

 

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com

Shannon FosterShannon Foster
Correct. So if one vendor submits an Gas service contract, and a different vendor submits an electric service contract for that same customer three months later I want the two service Contracts to link together. Possibly in a related list view so that when my employee is talking to a customer they can easily see that they are receiving our services for Electric and Gas. 
 
rajat Maheshwari 6rajat Maheshwari 6

Hi Shannon,

Please let us know, your best time for meeting in my mail id.as I need to discuss on meeting with you and need to get relevant details .

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com
 

Drop trackDrop track
Based on your requirements, it seems that you are looking to display related service contracts with the same phone number in separate sections on both gas and electric service contracts. While Salesforce has suggested using a trigger, it is not possible to directly link parent objects to each other as you can read on elprisidag.se (https://www.elprisidag.se/).