List View Customization

Hello list view tables are as follows:

customer-> customer_name, customer_id
vehicle-> vehicle_name, customer_id

I want the vehicle table to show customer_name names instead of customer_id.
I have set title fields etc. tried set_query and looked into list_js but the result is not achieved. I dont want to add another field customer name.

I just want to display the customer name instead of customer_id in the generated list view.

How can I achieve that?

Thanks!

I want the list view

Output:

Thanks - The structure is as follows:

ID - customer_id - customer_name …other fields

Setting title does not work in this case.

The generated list view is of the vehicle table and it has customer_ids i.e. it is NOT pulling the customer_id from the customer table. This data was imported through a csv file.

In other frameworks it is a simple matter of “return customer_name” instead of customer_id on the server side.

For any one stummped on this the id field is now mapped to the name field which is called from another table in the list view.

I was able to do it using

specifically this portion:

 parser: function(data, render, error) {
        let names = [];
        data.forEach(function(row) {
            names.push(row.name);
        });
        if (!names.length) {
            return render();
        }
        frappe.db.get_list('Doctype', {
            fields: ['name', 'price'],
            filters: {
                name: ['in', names],
                is_approved: 1,
            }
        }).then(function(list) {
            list.forEach(function(vals) {
                data.forEach(function(row) {
                    if (vals.name === row.name) {
                        row.price = vals.price;
                    }
                });
            });
            // Render modified data
            render();
        }).catch(function(e) {
            console.error(e.message, e.stack);
            // Render original data instead
            error();
        });
    },