Using Contacts ListView in custom List View

@pgr @LionSolution

Good news and bad

Good news:
I got Netbeans working with XDebug and the breakpints are functioning.
Turns out Debian 10 installs XDebug 2.7, which is deprecated and does not have the same setup as v3.x, which apparently Netbeans 13 prefers …
So I uninstalled the version of XDebug installed with apt and used pecl to instal v3.14 of XDebug and then followed their configuration instructions plus a few tweaks and it worked fine. See document attached for full explanation of the setup. (I like to document things I learned so I don’t have to go through the frustration again … :wink: )
Installing and Configuring Netbeans with XDebug.zip (27.8 KB)

The bad news
I still cannot get the darn thing to do what I want, even after stepping through the code ( few hundred clicks past the breakpoint - this is one convoluted set of code!) and trying to use the solution from

The problem is not the solution proposed. The problem is me not understanding how to edit that for my situation.

I did NOT create a new module. I linked Products and Contacts via a many-to-many relationship, including an extra “number” field to record the count of “Products” sold, and edited the subpanels to allow entering/editing the “Number” field.

I have a custom action_cpListView() in which I put

<?php
require_once('modules/Contacts/controller.php');
class CustomContactsController extends ContactsController
{
    public function action_cpListView()
    {
        $this->view = 'contact_product';
    }
}

and in my view.contact_product.php I put (with fake variable data just to see if it accepted my replacement data)

<?php

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

require_once('modules/Contacts/Contact.php');
class EditContactsTempArray extends Contact {
    function get_list_view_data(){
        // Get the default output
        $temp_array = parent::get_list_view_data();
        $temp_array['NAME'] = "TestName";
        $temp_array['TITLE'] = "TestTitle";
        return $temp_array;
    }
}

require_once('modules/Contacts/views/view.list.php');
class CustomContactsViewContact_Product extends ContactsViewList {
    /**
     * @see ViewList::preDisplay()
     */
    public function preDisplay()
    {
        require_once('modules/AOS_PDF_Templates/formLetter.php');
        formLetter::LVPopupHtml('Contacts');
        parent::preDisplay();

        $this->lv = new ContactsListViewSmarty();
    }
}

But when I go to the action, it just displays the original list of contacts and their data, without replacing it with my fake data.

So I am not understanding how this is supposed to work.

Either I am not putting my function to replace the data in the right place or I am just overriding that by calling the parent display function or …

Any suggestions?