Custom fields with customer entity not showing the names

Custom fields with customer entity not showing the names

The customer table does not have a name field. product and category have name fields.

So the following function in the file

/platform/src/Administration/Resources/app/administration/src/app/component/form/select/entity/sw-entity-multi-select/index.js

    displayLabelProperty(item) {
        const labelProperties = [];

        if (Array.isArray(this.labelProperty)) {
            labelProperties.push(...this.labelProperty);
        } else {
            labelProperties.push(this.labelProperty);
        }

        return labelProperties.map(labelProperty => {
            return this.getKey(item, labelProperty) || this.getKey(item, `translated.${labelProperty}`);
        }).join(' ');
    }
    
    Always return empty. label property default value name.
    
    The customer has a first name and last name so it is not showing.
    
    Is there any quick fix for this?

Add ‚labelProperty‘ => [‚firstName‘, ‚lastName‘] in custom field.

            'customFields' => [
                [
                    'id' => Uuid::randomHex(),
                    'name' => 'bbna_sales_manager_assigned_customers',
                    'type' => 'select',
                    'config' => [
                        'label' => [
                            'en-GB' => 'Assign customers to sales manager',
                            'de-DE' => 'Weisen Sie dem Verkaufsleiter Kunden zu'
                        ],
                        'componentName' => 'sw-entity-multi-id-select',
                        'customFieldType' => 'select',
                        'customFieldPosition' => 1,
                        'entity' => 'customer',
                        'labelProperty' => ['firstName', 'lastName']
                    ],
                ],
            ],