by Izertis

Create documents in docx, xlsx (MS Office Word and Excel), odt, ods (LibreOffice and OpenOffice) and pdf format without MS Office or others plugins installed from any module and subpanel using templates.

Includes a 30 day guarantee
Try it Now

#2986 - Getting record details from both sides of a one-to-many relationship of the same module

Closed Bug? created by sinergiacrm 3 years ago

Hi,

We found that when a relationship within the same module is set up, normally doing it from studio, the user can only access to the details of one of the ends of the relationship, more specially the "many" end relationship.

For example, we have a one-to-many relationship between Contacts-Contacts: Selection_125.png [In this example we have two relationships, but it would be the same with 1]

If we go to the Mail Merge Reports option for selecting variables, we can see that this relationship appears in the subpanels section, as the "many" end of the relationship: Selection_126.png

Then, if we go to the "relate" section, the "one" end of the relationship doesn't appear: Selection_127.png

AND if we try to call it directly from the template relationship@@.... still doesn't work.

However, trying the native relationship "reports_to" that exists in SuiteCRM-SugarCRM between Contacts-Contacts appears in both ends.

Looking for the differences of the "reports_to" relationship and the custom relationship that we made, we saw that this can be solved adding a definition in the vardef. For example:

$dictionary["Contact"]["fields"]["contacts_contacts_1_one"] = array ( 'name' => 'contacts_contacts_1_one', 'type' => 'link', 'relationship' => 'contacts_contacts_1', 'link_type' => 'one', 'source' => 'non-db', 'vname' => 'LBL_CONTACTS_CONTACTS_1_FROM_CONTACTS_L_TITLE', 'id_name' => 'contacts_contacts_1contacts_ida', ); Selection_124.png

We think that there might be a conflict within the name of the relationship fields for each of the ends.

The solution stated above could work as a temporary patch, but it requires a code-intervention from a developer. Do you think another permanent solution can be found to solve this?

Thanks a lot,

Alberto

  1. dharma member avatar

    Izertis Provider

    3 years ago

    Hi Alberto,

    We are sorry but this problem goes beyond what the component can do. SuiteCRM should be contacted to resolve this issue.

    After trying to create with SuiteCRM this type of relationship (just create one to see the problem) has been seen that is a problem of SuiteCRM itself, perhaps inherited from SugarCRM. With the images of the ticket, it seems that you use the old version of SugarCRM which would confirm it.

    If we create a field of type "relate" that is reflexive through the Studio, it is verified that it creates the relationship of the "one" part of the one-to-many. On the other hand if we create another reflexive relationship, also through the Studio, but from "Relationships" instead of "Fields", it is checked that the relationship is created in the "many" part of the one-to-many.

    In the case of the "reports_to" field it works correctly because it comes standard in the crm, and it already have been created correctly.

    By the way, if we create a normal one-to-many relationship between two different modules we will not have this problem, it works correctly, but if what we do is to create from the Studio a new "relate" field (at the end it is really only a one-to-many relationship) as a result we will have the relate type field in the module that has been created, but not the relationship. The Studio does not create in this case the "many" part.

    The component reads the existing relationships in the system to use them, but it can not fix this type of problem, can not infer relationships.

    Therefore, if SuiteCRM don't fix this problem, the only solution is as you said, is to extend the dictionary of the corresponding module by code (by adding a relate field or a relationship, as appropriate).

    Regards

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
  • "It has improved our processes so much! Admin cut in half! We send a webform to clients to sign up straight into CRM then generate and print their paperwork to sign."

    Read More Reviews