You need to sign in to do that
Don't have an account?
Crmzepher
Validating Opp Contact Role fields from Custom Button on Opps Tab
Hello,
Professional version with API
We have a custom button with exec javascript that validates a series of fields based on the user´s role before they can submit the Opp for approval by their Sales Mananger. All the standard validation works great and has been easy to access and program however I cannot figure out how to access the Opportunity Contact Role object from the native options within Salesforce to validate that a Role has been chosen, the Primary has been set, etc . . .
Futhermore there is no way create any valildation rules on the Opportunity Contact Role field directly or indirectly. For example if I wanted to create a validation rule on the Stage field that checks to see that the "Primary" contact has been chosen from all the contacts on the Opportunity Contact Role object when the Stage has been set to "Sold" there is no way to query the checkbox value on the "Primary" field.
What we want to accomplish is that no Sales Order goes forward without the "roles" of all the Opportunity Contact Roles being define and without a "Primary" chosen from all the contacts.
Does anyone have any ideas how this can be done?
thanks, crmzepher
Campaign management for contacts are basically useless if they are not being forced to chose a contact role for an opportunities.
Rhonda --
I am sorry for not having responded to this before now but appreciate your reply. I have implemented this app in my dev sandbox and have started doing some testing. I am not sure exactly what I need to put into the case statement after I have identified my stagename, here is what I have:
CASE( StageName , "Stage to be Required 1", 1, "Verbal Acceptance - 75%", ?,?)
I have a stage called: Verbal Acceptance - 75% and want any stage or probability above 75% to have a primary contact and role deifned. I would love to make a rep specify the 4 roles that we want for our projects but will take a single contact role if I can get that.
Any help is appreciated.
Wes,
The only values you need the CASE statement to lookup are the stage values that you want to trigger this rule.
You want the formula field to return a 1 to trigger the rule and a 0 if you don't so...
CASE( StageName , "Verbal Acceptance - 75%", 1,0)
I did it this way in Sandbox and it worked for me using my required stage values.
Is it possible to go the other way? I'm trying to require a contact decision maker before an opportunity would automatically change stages (using workflow rules).
--James
HI,
I am interested in this appexchange pkg, but can't seem to get there from the link rpr2 provided back in December. We don't necessarily care about a primary Contact being associated with the Opportunity, but just want ANY Contact before the Oppty can be Closed!
Thanks,
Liz
Maybe the link changed, here it is http://sites.force.com/appexchange/apex/listingDetail?listingId=a0N300000016cbDEAQ.
This app includes APEX and custom formulas that make an opportunity primary contact required a at the opportunity stages you specify in the custom formula the app creates.
I would recommend that you install this in your sandbox environment (if you have one) first and test it out to make sure it works. This app may trigger some of your custom validation rules or workflow rules that the original APEX does not account for.
That link worked. I will definitely try this in our sandbox first. That is basically where I live at the moment.
Many thanks
Is there a way to only make the Contact roles required after the intial Opportunity creation? Since Contact roles cannot be added in Edit mode, how do I only make Contact required after the initial Oppty is created? As is, users can create an Opportunity in any stage with the exception of Closed/Won. Was curious how other companies deal with this.
Liz
Initially we ran into the same problem. What we did is made the custom formula in the app only return true for all stages other than the first stage. Then make the first stage a requirement using a validation rule. This ensures that all opportunities start off at the same stage which does not require a primary contact role. Then if the user wants to change the stage they must first enter a primary contact role for the opportunity.
Also, creating opportunities from contacts instead of accounts will acheive this.
Thanks. I had both of those thoughts as well. Regarding creating an Oppty from the Contact instead of Account- I am having trouble figuring out how to restrict the New button on the Oppty tab and Create New section on side bar only for Opptys while keeping it on the Contact layout. Any tips? I think I need to take a beginner developer/programming course :smileyhappy: