Dynamically modify subpanel layout based on record values within the subpanel

SuiteCRM v7.8.2
Sugar v6.5.24
Apache 2.4
PHP 5.6
MariaDB 10.2
Ubuntu 16.04

I’m a bit new to SuiteCRM/SugarCRM but I have 10+ years experience in web/mobile app development.

I’m trying to modify a subpanel list view based on the field value of each record in the subpanel list.

I have a ParentModule and a ChildModule. The ChildModule has a field called “total” which can either have the values 1, 2, 3, or 4. If the value of this field is 1, then I want to remove the “EDIT” button for that record that is displayed in the subpanel (ChildModule) list.

I’ve investigated several options and different conflicting pieces of documentation on how to implement this change.

It’s also worth noting that I do not want this to affect the ChildModule’s list view when it is not within a subpanel.

I’ve found that maybe a combination of a custom .tpl and the module class, but I cannot get it to work with the subpanel, I can only figure out how to modify the actual list view (not in the subpanel).

Does anyone have any insight on how to do this? For example, where is the loop that populates the subpanel list with records??


You need to override Subpanel Edit Button and create new generic button.

You may start debugging from here. include/generic/SugarWidgets/SugarWidgetSubPanelEditButton.php

Hope this helps you.

How do you suggest I do that? Your feedback is insightful, but it isn’t actionable. For me, some additional steps and guidance would be appreciated. Thank you so much urdhvatech.