You need to sign in to do that
Don't have an account?
morley
How to validate for Opportunity Contact Role?
Hi there,
I'm trying to create a validation rule to ensure that when a user creates an Opportunity that they also create at least one Opportunity Contact Role.
I'm pretty sure this isn't possible, because validation would have to occur on the edit page of the Opportunity, but OCRs aren't created there. However, when I go to create a validation rule for Opportunity, in the list of available merge fields, there's a field called ContactID. What does that refer to and would it be useful for my purpose?
Thanks for any help!
Morley.
I'm trying to create a validation rule to ensure that when a user creates an Opportunity that they also create at least one Opportunity Contact Role.
I'm pretty sure this isn't possible, because validation would have to occur on the edit page of the Opportunity, but OCRs aren't created there. However, when I go to create a validation rule for Opportunity, in the list of available merge fields, there's a field called ContactID. What does that refer to and would it be useful for my purpose?
Thanks for any help!
Morley.
However, to answer your original question, no, you can't validate against related items. Even if you could, it would be a chicken-and-egg (eg. "Chinese Trap", "Catch-22") problem. You wouldn't be able to create new opportunities; to create the opportunity you'd have to add the contact role, but you can't add contact roles until you create the record.
Of course, you could code around this, but in that case, it still wouldn't force the users to add roles until they tried to edit the record later. Enterprise Edition organizations (or if you have the API) could override the edit button with an S-Control. In this case, the code would check to see if there are contact roles on the existing record; if not, force them to the contact roles page, otherwise allow the edit. Or, an S-Control could force a user looking at the detail page to add contact roles if there are no associated contact roles for the opportunity.
The Apex Code feature would likely allow something like this to work entirely on the Salesforce server in the future, allowing greater flexibility (or, even better, automatically adding contact roles so the users don't have to remember).
~ sfdcfox ~
You can try this functionality with a custom button.