If the Custom Object has a Master-Detail(Child) relationship to the Opportunity, you can create a Roll-Up Summary field on the Opportunity that returns the COUNT of the Custom Child Object records. Then you can write a VR that will throw an error if certain conditions on the Opportunity are TRUE and the Roll-Up Summary field is < 1.
If the Custom Object has a Master-Detail(Child) relationship to the Opportunity, you can create a Roll-Up Summary field on the Opportunity that returns the COUNT of the Custom Child Object records. Then you can write a VR that will throw an error if certain conditions on the Opportunity are TRUE and the Roll-Up Summary field is < 1.
I've just set this up with a custom object under opportunities but have noticed a problem. If you go to create or edit an opportunity the custom objects don't appear until after you have saved what you have done. This means that with the current validation rule in place I can't create an opportunity because I need to add information to the custom object first.
That's just something that you have to live with in SFDC, it's no different than creating an Activity, Contact Role, Product, etc. that are related to the Opportunity. You can't have 2 related records open for editing at the same time.
I thought that would be the case. The formula was just:
Summary_of_Greenlight_Staff_Role__c < 1
The custom object is used to show the staff associated with the opportunity.
The only thing I can think of is to create a workflow that sends the opportunity owner a reminder after they have created an opportunity to add staff to the custom object.
Hi Jane,
If the Custom Object has a Master-Detail(Child) relationship to the Opportunity, you can create a Roll-Up Summary field on the Opportunity that returns the COUNT of the Custom Child Object records. Then you can write a VR that will throw an error if certain conditions on the Opportunity are TRUE and the Roll-Up Summary field is < 1.
All Answers
Hi Jane,
If the Custom Object has a Master-Detail(Child) relationship to the Opportunity, you can create a Roll-Up Summary field on the Opportunity that returns the COUNT of the Custom Child Object records. Then you can write a VR that will throw an error if certain conditions on the Opportunity are TRUE and the Roll-Up Summary field is < 1.
Thanks Steve - I knew there had to be something! That works - thanks again.
I've just set this up with a custom object under opportunities but have noticed a problem. If you go to create or edit an opportunity the custom objects don't appear until after you have saved what you have done. This means that with the current validation rule in place I can't create an opportunity because I need to add information to the custom object first.
Any ideas?
That's just something that you have to live with in SFDC, it's no different than creating an Activity, Contact Role, Product, etc. that are related to the Opportunity. You can't have 2 related records open for editing at the same time.
Can you post the code for your Validation Rule?
I thought that would be the case. The formula was just:
Summary_of_Greenlight_Staff_Role__c < 1
The custom object is used to show the staff associated with the opportunity.
The only thing I can think of is to create a workflow that sends the opportunity owner a reminder after they have created an opportunity to add staff to the custom object.