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
YuckleYuckle 

Related Opportunity

We have a custom button on our case layout screen "New Opportunity" that when clicked creates a new Opportunity.  This new oppportunity has a custom field Related Case that gets loaded with the case number of the case we were on when we clicked the button.  So we have a useful link from Opp to parent Case.  

 

But, when looking at the case we have no indication that there is a related Opportunity.  Is there a way to have a Related Opp field in the case record that gets created when we click the custom button so that we have a Case to child Opp link?

shillyershillyer

Is the New Opportunity button on a related list in the Case page layout? If so, you should be able to see the related Opportunities when viewing a Case. It sounds like there's a lookup relationship from Opportunity to Case.

 

If you want to see the other way around, you could create a lookup relationship field on the Case to Opportunity. Then when you are viewing an Opportunity, you'll see a related Case list that allows you to create an Case with related Opportunity pre-filled.

 

If you determine there will be instances where there can be a case with many opportunities and an opportunity with many cases, you can create a many-to-many relationship using a junction object.

 

Hope that helps,

Sati

YuckleYuckle

Thanks for responding

 

The New Opportunity Button on on the case layout page, to the right of the standard buttons (Edit, Delete, Close Case, Clone), but it's not on a related list.  There is a custom field in the Opportunity record Related Case - Lookup (Case).   I beleive the url that is attached to the custom New Opportunity button has a merge field for the case record number in it and this is how it gets populated into Related Case in the new Opp. 

 

I could easily create a lookup field Related Opportunity - Lookup(Opportunity) on the case record but I don't know how it will get populated since the opportunity doesn't exist yet when the button is pushed and we go off to display the New Opportunity page.  It seems to me I'd need some process that said:

 

In this new opportunity, I see it has a related case.  Go to that case and load this opportunity name into the Related Opportunity field. 

 

or some other process that accomplished this

RevJoelRevJoel

Bump. I have the same dilemma. It would be nice if I could add Opportunities as a related list to Cases. Is this possible somehow?