Contact/Opportunity relationship: Missing 'Role' field in the Opportunities 'Contact subpanel'

I don’t think Studio ever was able to add relationship fields. I agree they are a standard element in database design, they should be there.

This addition would be a great contribution from somebody in the community. But it is a hard job, definitely not for a PHP or SuiteCRM newbie…

Hi,

Did somebody get a solution on displaying the contact role starting from the contact detail view and looking to the opportunity subpanel or something similar?
I tried what suggested by PStevens (turning opportunity role field studio to “true”, in varfed.php). I could see the opportunity role but once added the field to the edit or detail or contact list view I could select an option from the role menu, but once save it did not display anything I selected (always blank).

Thanks
Mario

You don’t need to do anything. Simply go to the Opportunity, In the subpanel for “contacts” just add one. Then once it’s added click on the “edit” button and you should be able to edit the contact opportunity role.

@mariofucile OK I see what you’re saying. You must be talking about SuiteCRM 8. This feature appears to be missing. When I click on the contact in the Opportunity subpanel in 8 it just goes to edit the record and not the opportunity role page. You can’t just show a single relate field in the contact as this is a many to many relationship. I don’t think you’re going to be able to edit that in 8 without this feature being added.

Added to issues for SutieCRM 8: #100

Hi PStevens,

Thanks for your reply.

Sorry I missed to mention my SuiteCRM version which is the 7.12.5.
Apart from that, I was already ok with selecting the “Role” from the “Contact” subpanel present in the “Opportunity” detail view. No problem for that.
My question, was intended to have the same information (“Role”) at the opposite, I mean displaying
the “Role” in the Opportunities subpanel starting from a Contact detail view.
As described in studio the “opportunity_role” is not present in the list selecting the Opportunities
subpanel of the Contact, unless I turn the opportunity_roles fields to “true” in the vardef.php file.
After that it appears, I can select it, I see it in the opportunity subpanel of the contact, but it is useless,
even if you select one of the role menu option, keep remaining blank.

Thanks
Mario

So you’re wanting to show the “opportunity role” in the contact record side, in the Opportunity subpanel? I don’t think that would be possible (at least not without writing code). The opportunity subpanel shows fields from the Opportunity. The “Opportunity Role” is a contact record as I understand it. There is a third table in the database (because it’s a many to many relationship). You’d have to write some custom code to go and get that relationship from the database table.

Yes right,

After reading this old post I just asked if somebody had a way to have the role info in the opportunities subpanel shown from the contact details view. From what you say I do understand it is too difficult.

Thanks anyway for your kind reply and have a good day.
Mario

Hi Mario, are you ok to fill the Opportunities Role with any Contact field?
It’s related to your specific scenario.
Usually a Contact could be the decision maker in one Opportunity and a simple “influencer” in another one.
If it works for you, i’d put an after_relationship_add LogicHook in the Contacts module to achieve it

Hi LionS,

Thanks for helping out.

Maybe my request is misunderstood.

Starting from your point, that is the same contact can have different roles for different opportunities is involved in, why not displaying the contact role in the opportunities listed from the subpanel present in the contact detail view. The same role displayed listing the subpanel contacts from the opportunity detail view.

Thanks
Mario

Hi Mario, could you please share a screenshot of what you are looking for? Don’t worry, it could be a draft made even via Paint

Hi LionS,

Here you find my draft. I putted a partial details view of both an opportunity and a related contact. Added also some notes to understand what I would like to have.

Hope this clarify.

Thanks again.
Mario

Ok! Now i’ve understood what you were looking for.

Please check this:

Hi LionS,

Actually I started from there, but found out that the solution suggested did not work.

See:

Thanks
Mario