Frontmatter
| id | 5254 |
| title | form.field.Select: beforeSetValue() |
| state | Closed |
| labels | bug |
| assignees | tobiu |
| createdAt | Feb 20, 2024, 12:03 PM |
| updatedAt | Feb 20, 2024, 12:05 PM |
| githubUrl | https://github.com/neomjs/neo/issues/5254 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 20, 2024, 12:05 PM |

this.recorddoes get overruled at the end of the method.this code is weird:
beforeSetValue(value, oldValue) { let me = this, displayField = me.displayField, store = me.store, record; if (Neo.isObject(value)) { me.record = value; return value[displayField]; } else { record = store.isFiltered() ? store.allItems.get(value) : store.get(value); if (record) { me.record = record; return record[displayField]; } } me.record = store.find(displayField, value)[0] || null; return value }this.record should get set to null in case the local record var is undefined.
@ExtAnimal