You need to sign in to do that
Don't have an account?
Jeff Fontas
Custom Objects with multiple standard object lookups, how best to handle it?
I have been trying to figure out how best to accomplish a certain functionality I want on a custom object page layout, and I have yet to find the answer. Basically, I have created a standard object called "Seminar", which has a lookup field for Opportunity. I also want to display the Account and Opportunity Owner on the Opportunity object on the page layout of the Seminar object.
So far, I have tried to accomplish this two ways. First, I tried creating a button on the Opportunity page layout for creating new seminars. This button prepopulates data from the Opportunity into the fields in the Seminar. Clicking it would could copy the data as follows:
Opportunity Field Seminar Field
Opportunity -> Opportunity lookup
Opportunity.Account -> Account lookup
Opportunity.Owner -> User lookup
After doing this, I discovered I was not happy with the results. Yes, I minimized data entry (one of my goals) but the fields would not update if the parent fields on the opportunity changed.
Looking around, I discovered that a formula might be the best way to accomplish displaying the fields from Opportunity object on the page layout of the Seminar object:
Opportunity Field Seminar Field
Opportunity -> Opportunity lookup
Opportunity.Account -> Formula: HYPERLINK("/" & Opportunity__r.Account.Id, Opportunity__r.Account.Name)
Opportunity.Owner -> HYPERLINK("/" & Opportunity__r.OwnerId, Opportunity__r.Owner.FirstName & " " & Opportunity__r.Owner.LastName)
After setting this up, I was still unhappy. I had three issues with the formula approach:
1. I have to create a hyperlink for the formula fields to link back to the objects for those fields. Not a huge deal but kind of a pain.
2. I can no longer use related list functionality on the account page because it is a formula field and not a lookup.
3. I no longer get the hover tooltip that displays additional information about the related object that I would get from a lookup field when users hover over the link.
Anyway, for a tl;dr, my question is:
Is there any way to display fields that are on a parent/related object in the child page layout such that the child fields automatically populate/update when there are changes to the parent object, while also being able to utilize related lists and the hover tooltip?
So far, I have tried to accomplish this two ways. First, I tried creating a button on the Opportunity page layout for creating new seminars. This button prepopulates data from the Opportunity into the fields in the Seminar. Clicking it would could copy the data as follows:
Opportunity Field Seminar Field
Opportunity -> Opportunity lookup
Opportunity.Account -> Account lookup
Opportunity.Owner -> User lookup
After doing this, I discovered I was not happy with the results. Yes, I minimized data entry (one of my goals) but the fields would not update if the parent fields on the opportunity changed.
Looking around, I discovered that a formula might be the best way to accomplish displaying the fields from Opportunity object on the page layout of the Seminar object:
Opportunity Field Seminar Field
Opportunity -> Opportunity lookup
Opportunity.Account -> Formula: HYPERLINK("/" & Opportunity__r.Account.Id, Opportunity__r.Account.Name)
Opportunity.Owner -> HYPERLINK("/" & Opportunity__r.OwnerId, Opportunity__r.Owner.FirstName & " " & Opportunity__r.Owner.LastName)
After setting this up, I was still unhappy. I had three issues with the formula approach:
1. I have to create a hyperlink for the formula fields to link back to the objects for those fields. Not a huge deal but kind of a pain.
2. I can no longer use related list functionality on the account page because it is a formula field and not a lookup.
3. I no longer get the hover tooltip that displays additional information about the related object that I would get from a lookup field when users hover over the link.
Anyway, for a tl;dr, my question is:
Is there any way to display fields that are on a parent/related object in the child page layout such that the child fields automatically populate/update when there are changes to the parent object, while also being able to utilize related lists and the hover tooltip?
you can create lookups (Account and User) instead of formula fields and populate them with a trigger (on create and update) on your seminar object that will copy the Opportunity Account and Owner in your lookups.
Jerome
All Answers
you can create lookups (Account and User) instead of formula fields and populate them with a trigger (on create and update) on your seminar object that will copy the Opportunity Account and Owner in your lookups.
Jerome