Hi, I need to add a filter for an enum filed in a custom view in getSelectedFilter function.
Here is my custom view and attached image:
Espo.define('custom:views/rapportini/fields/contratti', 'views/fields/link', function (Dep) {
return Dep.extend({
getSelectFilters: function () {
if (this.model.get('accountId')) {
return {
'account': {
type: 'equals',
attribute: 'accountId',
value: this.model.get('accountId'),
data: {
type: 'is',
nameValue: this.model.get('accountName')
}
},
'stato':{
type: 'equals',
attribute: 'stato',
value: this.model.get('stato'),
data: {
type: 'anyOf',
nameValue: 'aperto'
}
}
};
}
},
getCreateAttributes: function () {
if (this.model.get('accountId')) {
return {
accountId: this.model.get('accountId'),
accountName: this.model.get('accountName'),
}
}
}
Here is my custom view and attached image:
Espo.define('custom:views/rapportini/fields/contratti', 'views/fields/link', function (Dep) {
return Dep.extend({
getSelectFilters: function () {
if (this.model.get('accountId')) {
return {
'account': {
type: 'equals',
attribute: 'accountId',
value: this.model.get('accountId'),
data: {
type: 'is',
nameValue: this.model.get('accountName')
}
},
'stato':{
type: 'equals',
attribute: 'stato',
value: this.model.get('stato'),
data: {
type: 'anyOf',
nameValue: 'aperto'
}
}
};
}
},
getCreateAttributes: function () {
if (this.model.get('accountId')) {
return {
accountId: this.model.get('accountId'),
accountName: this.model.get('accountName'),
}
}
}