How to access an information hold by a relationship in my view / layout / field ?

Hello,

I want to improved the Contact subpanel for the account's module, by including an additionnal CSS property to highlight contact that do not "work" anymore for the account, ie the contacts marked as not primary in the relationship accounts_contacts table.

But I don't know how to access this property from my model...

In my idea, it should be something similar to the Contacts subpanel for opportunity, where you can see the ROLE, which is also an attribute of the relationship between the contact and the opportunity.

Any help / idea is welcome...maybe from my "bests" helpers :-) Cédric Mourizard Angel Magana Francesca Shiekh André Lopes hats Matt Marum Michael Shaheen ???

Best regards,

Fred

  • Hello Fred,

    To improve the CX: do not use that  Maybe you can try to duplicate this information in a non-db field set during the relationship retrieving by overriding the linkclass or the api endpoint however both are not very "nice" probably.

    Without joking, may be you can use this as a real one-to-many and a custom module which store the history of the relationship with date to start and end like a qualified relationship. By this way to can do everything on front end and most of all you can report that as you want.

  • frinaldi,

    Cédric Mourizard is perfectly right. (Hi Cedric! I hope you are doing fine!)

    Usually for this scenario I suggest to create a new "Employment" module with start and end dates and status and relationships with Contacts and Accounts.

    Then I would recommend to create some hooks (mostly relationship based hooks) to maintain those records based on if a Contact is related or not to an Account via the standard relationship.

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • Hello and thank you Enrico Simonetti and Cédric Mourizard,

    This is currently the solution we used.

    But, because there is the same kind of behavior in the contact's opportunity subpanel, I want to know it there was an easy way to get this "attribute" of the relationship in my subpanel and then extend it.

    It seems that, according to your answers, it's a no.

    Many thanks one more time, and I hope that all of you and your families and relatives and friends are fine.

    See you soon,

    Fred

  • This is how we did it without logic hook

  • Hello Greg Barrass,

    So the Status is displayed according to the information hold by the link between the account and the contact or is it only an additionnal field on the contact record ?

    Because, if it's the second option, it mean that you need to duplicate contact if he moved from one account to another one, and this is what we want to avoid.

    Fred

  • hi frinaldi
    Forgive me if you have already considered the main flaw with moving Contacts to different Accounts?

    As you move a Contact, all their related info that was only relevant to the previous Account has now moved with them, therefore missing from that Account and it's historical records.
    Or are you planning on covering this issue some other way?