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

Fields in Relationships is an under-developed area in SuiteCRM. Iā€™m afraid it is simply not supported in Studio.

There are elaborate ways to play with these things, but all at the PHP level, see here, with some further clarifications here.

These kinds of fields are used rarely in SuiteCRM, but the case youā€™re mentioning is one (and one I wasnā€™t even aware of yet).

fact is it is common and it is supported from suitecrm the half way.
It does not need to be supported in Studio as fully managed system.

I am just asking to show the field in Studio contacts subpanel as it already shows in Studio opportunities subpanel.
That is not a big step for those who can look behind the screens.

Yes, but I donā€™t know the details very well, I only did this once and with great difficulty.

Unless somebody else comes here and answers you (which I doubt), youā€™ll have to look at those posts I linked, then go looking for the files that implement the Opportunities sub-panel, and then copy the mechanism into the Contacts subpanel.

Good luck and please share your findings once you get it to work :slight_smile:

Hi,

Seems that this issue is fixed in the current version : I see the role of the Contact in the Opportunities ā€œContact subpanelā€.
However, I would like the oppostie way : how can I display the role of the contact for each opportunity in the Contacts ā€œOpportunity subpanelā€ ?
Like this, in the Contact module, I can see all his opportunities with his role for each. Is it possible ?

Thanks

Hey This was never an issue, It was my stupidity on how to edit the Opportunity Role. LOL. Anyway, I ā€œthinkā€ (I havenā€™t tried it myself), but if you went into Studio and edited the subpanel view for ā€œOpportunitiesā€ from the Contact Module, and added the column for ā€œOpportunity Roleā€. I think that would get you what youā€™re looking for.

Havenā€™t tried it myself, so canā€™t guarantee the field is available to add, but thatā€™s where I would start.

Thanks for your reply.

Unfortunately, there is no Opportunity Role module. It seems that we can only display column from the Opportunity table, but not the columns from the Opportunity_Contact table

my understanding is this:

cuitecrm has included an relationship field ā€œroleā€ in the relationship table between contacts and opportunities.
Then they have changed the subpanel under opportunities contacts to handle the relationship field (not the opportunity and not the contact).
This is working fine.

Suitecrm did not do the other part in the Contacts subpanel for opportunities.

There are some reported ways to add relationship fields but they do not cover both ways and they are outdated and and have some hurdles to take but it is possible to replicate what suitecrm did on the opportunity side.

Even though it is not an important topic it should be possible to handle relationship fields in studio. Having relationshipfields helps to describe what happens between to modules. It can be seen as a history or to document what or when something happened. As an example can a customer play different roles in different opportunities or a contact who has started to work in an account and might later have taken another job in another account and you have to document this. There are many good reasons to have this functionality.
Best would be if we could update the relationship fields on both sides of the two engaged modules trough studio. Studio is an outdated software. It is not possible or at least not anymore in new versions. I could not find a way to change this nor was it possible use studio as proposed in this thread.

1 Like

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