# "displayField" von "Shopware.form.field.Search" für ein Model ändern

**URL:** https://forum.shopware.com/t/displayfield-von-shopware-form-field-search-fur-ein-model-andern/41417
**Category:** Programmierung
**Created:** [17. November 2016 um 01:05 UTC](https://forum.shopware.com/t/displayfield-von-shopware-form-field-search-fur-ein-model-andern/41417 "2016-11-17T01:05:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lenz](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@lenz](https://forum.shopware.com/u/lenz)
#### Post date: [17. November 2016 um 01:05 UTC](https://forum.shopware.com/t/displayfield-von-shopware-form-field-search-fur-ein-model-andern/41417/1 "2016-11-17T01:05:40Z")

</div>

Hallo zusammen,

ich habe ein kleines Problem. Ich würde gerne das ExtJS Model “Shopware.apps.Base.model.Customer” als ManyToOne-Association einbinden. Das funktioniert auch alles soweit:

```
Ext.define(...
	extend: 'Shopware.data.Model',

...

	associations: [
		{
			relation: 'ManyToOne',
			field: 'customerId',

			type: 'hasMany',
			model: 'Shopware.apps.Base.model.Customer',
			name: 'getCustomer',
			associationKey: 'customer'
		},
	]
});

```

Nun habe ich das Problem, dass ich gerne das&nbsp;Shopware.form.field.Search so konfigurieren möchte, dass es nicht auf das Attribut “name” geht, sondern auf “customernumber”. Leider komme ich dabei nicht weiter.

Wie kann ich die Eigenschaft “displayField” von “Shopware.form.field.Search” für ein Model ändern?

---

<div class="post-metadata">

### Author: ![Beyer](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@Beyer](https://forum.shopware.com/u/Beyer)
#### Post date: [30. November 2016 um 18:02 UTC](https://forum.shopware.com/t/displayfield-von-shopware-form-field-search-fur-ein-model-andern/41417/2 "2016-11-30T18:02:22Z")

</div>

Hallo Lenz,

die Antwort die du suchst ist hier:

[https://forum.shopware.com/discussion/comment/179091/#Comment\_179091](https://forum.shopware.com/discussion/comment/179091/#Comment_179091)

Der gepostete Code von&nbsp;[tim\_netztronauten](https://forum.shopware.com/profile/24163/tim_netztronauten)&nbsp;muss in deine view/detail - Datei rein.

Hoffe konnte helfen.

Gruß

Johannes
