Custom Module in Relate To list view

Hi everyone,
I have a problem in the list view of the Notes module related to a Custom module of mine called NP_NotePlus.
The relationship is 1 NP_NotePlus to many Notes.
The problem is that I can’t present the name of the NP_NotePlus record related to the Notes record in the list view.


I have already attached in the drop down record_type_display_notes the new entry with the correct Custom form name.
Let’s say that in the list view it can only get the correct parent_type.

Thanks

@web_elinet

You wrote two different information.
Do you use relationship or group fields: parent_name, parent_type, parent_id?

Between the two modules I use a one-to-many relationship

You can use field of one-to-many relationship on listview form.
The fields parent_name , parent_type , parent_id should be deleted.

I have inserted the field np_noteplus_notes_1_name in the list view but it does not display the names

@web_elinet
Do you use Studio or make relationship/field manually?
Can you show actual file listviewdefs.php?
You have very strange column name Related to. The name default is setting for field parent_name.

Hi,
I created the relationship with Studio.
Here is the content of listviewdefs.php

    <?php
    $listViewDefs ['Notes'] = 
    array (
      'NAME' => 
      array (
        'width' => '40%',
        'label' => 'LBL_LIST_SUBJECT',
        'link' => true,
        'default' => true,
      ),
      'PARENT_NAME' => 
      array (
        'width' => '20%',
        'label' => 'LBL_LIST_RELATED_TO',
        'dynamic_module' => 'PARENT_TYPE',
        'id' => 'PARENT_ID',
        'link' => true,
        'default' => true,
        'sortable' => false,
        'ACLTag' => 'PARENT',
        'related_fields' => 
        array (
          0 => 'parent_id',
          1 => 'parent_type',
        ),
      ),
      'PARENT_TYPE' => 
      array (
        'type' => 'parent_type',
        'label' => 'LBL_PARENT_TYPE',
        'width' => '10%',
        'default' => true,
      ),
      'FILENAME' => 
      array (
        'width' => '20%',
        'label' => 'LBL_LIST_FILENAME',
        'default' => true,
        'type' => 'file',
        'related_fields' => 
        array (
          0 => 'file_url',
          1 => 'id',
        ),
        'displayParams' => 
        array (
          'module' => 'Notes',
        ),
      ),
      'CREATED_BY_NAME' => 
      array (
        'type' => 'relate',
        'label' => 'LBL_CREATED_BY',
        'width' => '10%',
        'default' => true,
        'related_fields' => 
        array (
          0 => 'created_by',
        ),
      ),
      'DATE_ENTERED' => 
      array (
        'type' => 'datetime',
        'label' => 'LBL_DATE_ENTERED',
        'width' => '10%',
        'default' => true,
      ),
      'NP_NOTEPLUS_NOTES_1_NAME' => 
      array (
        'type' => 'relate',
        'link' => true,
        'label' => 'LBL_NP_NOTEPLUS_NOTES_1_FROM_NP_NOTEPLUS_TITLE',
        'id' => 'NP_NOTEPLUS_NOTES_1NP_NOTEPLUS_IDA',
        'width' => '10%',
        'default' => true,
      ),
      'DATE_MODIFIED' => 
      array (
        'width' => '20%',
        'label' => 'LBL_DATE_MODIFIED',
        'link' => false,
        'default' => false,
      ),
      'CONTACT_NAME' => 
      array (
        'width' => '20%',
        'label' => 'LBL_LIST_CONTACT',
        'link' => true,
        'id' => 'CONTACT_ID',
        'module' => 'Contacts',
        'default' => false,
        'ACLTag' => 'CONTACT',
        'related_fields' => 
        array (
          0 => 'contact_id',
        ),
      ),
    );
    ;
    ?>

@web_elinet

I don’t see any problems.
You column ‘Communicazioni moduli’ is empty.
Do you selecting record for relationship in ‘EditView’ form of this module or in subpanel of another module?

Hi, when you have a one-to-many relationship, you should be able to add the field “NotePlus [np_noteplus_notes_name]” through:

Studio / Modules / Notes / Layout / Listview

I would advise you to “Restore Default” on this listview and then add your field through studio and see if it works.

The fact that you have a “_1” in “NP_NOTEPLUS_NOTES_1_NAME” might indicate that you deployed your module multiple times. For ModuleBuilder I advise not to “Deploy” but to always “Publish” your module and then install it through Module Loader.
In case of changes in Module Builder you would uninstall the module from module builder and then install the new one.

It isn’t correct because he use Studio. Studio add index every time when you make new field. For relationship one-to-many Studio make 3 special fields.

Yes i selecting record for relationship in subpanel of another module.

Do you see record in subpanel after addition? Which version of SuiteCRM do you use?

Hi,
yes of course, I see the records in the sub-panel after adding them (See screnshot showing the detail view of a NP_NotePlus Record and in the sub-panel the linked notes)

I don’t see records on subpanel of the screenshot from screenshot of post:


Do you sure the module on subpanel and screenshot of post before is of one module?

Hi,
I figured out where the problem is because it occurs to me with other modules as well.
I try to be clearer with a new example.
In CRM I have created a custom module GO_Organizations.
To be able to see it in the parent_type field of Calls, so as to relate a call with the custom module, I performed the following actions:

  • I created the 1-to-many relationship between GO_Organizations and Calls.
  • I added in the drop down parent_type_display the name of the custom module GO_Organizations.
  • Rebuilt and repair

Now in the parent_type field of the calls I can choose the custom module and its record.

When I save I don’t find the call in the Calls subpanel in the GO_Organizations module, I find it in the Activities subpanel.

This is because by saving the call, the parent type name and its record are written to the parent_type and parent_id fields of the call record.

Mentre il subpanel delle Chiamate, nella scheda del modulo GO_Organizzazioni, prende i dati scritti nella tabella dedicata alla relazione go_organizzazioni_calls_1_c.

Is there any instruction to make the subpanel also take data from calls that are in the activity subpanel?

Thanks

@web_elinet

“relationship” and “parent_…” are different mechanisms. Suppanel “Activities” use “parent_…” You can use “WorkFlow” or “LogicHook” for add calls from subpanel “Activities” to subpanel “Calls”.

1 Like