diff --git a/docs/ReferenceManyField.md b/docs/ReferenceManyField.md index 42b261ddb4c..9d48cea25f1 100644 --- a/docs/ReferenceManyField.md +++ b/docs/ReferenceManyField.md @@ -104,7 +104,7 @@ export const PostList = () => ( | `target` | Required | `string` | - | Target field carrying the relationship on the referenced resource, e.g. 'user_id' | | `reference` | Required | `string` | - | The name of the resource for the referenced records, e.g. 'books' | | `children` | Required | `Element` | - | One or several elements that render a list of records based on a `ListContext` | -| `source` | Optional | `string` | `id` | Name of the property to display | +| `source` | Optional | `string` | `id` | Target field carrying the relationship on the source record (usually 'id') | | `filter` | Optional | `Object` | - | Filters to use when fetching the related records, passed to `getManyReference()` | | `pagination` | Optional | `Element` | - | Pagination element to display pagination controls. empty by default (no pagination) | | `perPage` | Optional | `number` | 25 | Maximum number of referenced records to fetch | @@ -217,6 +217,20 @@ By default, it orders the possible values by id desc. You can change this order ``` {% endraw %} +## `source` + +By default, `ReferenceManyField` uses the `id` field as target for the reference. If the foreign key points to another field of your record, you can select it with the `source` prop. + +```jsx + + ... + +``` + ## `target` Name of the field carrying the relationship on the referenced resource. For instance, if an `author` has many `books`, and each book resource exposes an `author_id` field, the `target` would be `author_id`.