Hi!
I'm trying to add a new relation field to TaskModel. I started with just adding the field (I'll try to keep the code here simple):
class MyTaskModel extends TaskModel {
static get fields() {
return [
{ name: 'resourceGroup' },
]
}
And I edit it with a combo in the task editor:
{
type : 'combo',
label : 'Group",
clearable: true,
name: 'resourceGroup',
ref: 'resourceGroupCombo',
store : this.model.resourceGroupsStore,
displayField: 'name',
valueField: 'id',
async onChange({ source : combo, value, userAction }) {
// Code to apply value to record
}
},
With this, it works mostly fine but elsewhere in my code I'd like to access task.resourceGroup as an object, but it's an integer. And that makes sens.
I think I have to create a new resourceGroupId integer field and declare the resourceGroup field as being a relation in "static get relationConfig()" but I can't find any info on how to do that properly.
Could you provide some direction?
Thanks a lot!