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
SunnyButCloudySunnyButCloudy 

Show case items on opportunity level

Hello,

 

Is there any way to show case information on an opportunity?  I know we can tie cases to accounts, and all of the account's cases show on opportunities.

 

So I have a two-part question:

 

1) I'd like to limit an account to only have a certain case record type.  (Can I use validation rules to make this happen?)

 

2) Show a case field from that record type on an opportunity.  (I'm assuming that can be done via Apex).

 

Please help...I've been trying to do this but am stuck.  =\

 

Thank you x 100 in advance.

 

 

 

 

SunnyButCloudySunnyButCloudy

What I've done so far:

 

1) Created a lookup on Opportunity object called "Related Case".

 

2) Created a formula field on Opportunity object to pull in the Status of the "Related Case".

 

Still having problem: How can I pre-populate the Case that has a certain record type in the lookup field? 

KalyanLKalyanL

As you have already created a lookup that is good.  I think you can write a trigger to update this field at the time of creating a case for the oppurtunity.  There are two ways of accessing the oppurtunity.  Either from the Account or from OpprtunityContactRole. 

SunnyButCloudySunnyButCloudy

Thanks for the reply kalyanrm.  We're not using contact roles so I would have to link account,opp,case together.  Do you know how i'd be able to write an after update/insert trigger on case?