Add data in subpanel

Hi, I’ll explain my problem:
I created a module, inside I inserted a subpanel which is related to one with many with another previously created module and which has its data.
Now, the moment I create the relationship, a subpanel is created, but it’s empty, how do I make the data appear? How do I enter the query to view this data? Where should it be inserted? Which files should I edit?
Thanks

Hello,
In the ideal case when you create a relationship with any module, It will create a relationship table. and whenever you create a new record from subpanel or in edit view and relate to the relationship from the create view. It will insert a new record in the relationship table and based on the layout def it will display the records in the subpanel view.
In the subpanel you will have two button

  1. Create - Allow to create new record and relatinoship with parent records
  2. Select - This button opens the popup and allow you to relate existing records.

Here are some documentation about the relationship.

Hi urdhvatech,
i don’t want to create a new record from the subpanel, I would like the subpanel to automatically show the records that are already present in the module table, as if it were a view.list. How do I show the list of records in the subpanel? Of course by setting a query, but where?

Hello,
Here is some subpanel custom code that we tried for our blog earlier,
You can play around this.

You need to change accordingly.

Yes, I had tried it and it works, but it’s ok if I create a custom subpanel from 0, instead I have a subpanel created by Studio.
The idea you posted to me, I discarded it because a query was made for each line and since I also needed to customize the header of the subpanel fields and their content, I created for each one a link to a widget, then the execution of a new query was also multiplied by the number of header fields, and since we are talking about thousands of records, the execution time was very high

Then, I would suggest create a custom table jq table or simple html table in detailview and write a custom query as per your need. that will give you full control over data and view also.

Sorry, I have recently been dealing with SuiteCRM and I don’t understand this … what is the classic way of acting, how do you add data to the subpanel? If I relate two tables, it is natural that these two tables have data, is it really so complicated to make the data appear in the subpanel? When I create a subpanel, how do I implement it? It seems a trivial question to me, but I don’t find anything around, not even in the tutorials

ok, I solved it like this:
when I create a relationship with another module, a relationship table is automatically created, in this table the id of the second module must be entered in the field …_ ida

1 Like