Scenario:
In the current solution I am working with we have implemented a custom approval process. an order should be approved by 2 authorizers and we assign each customer with 2 specific authorizers by setting them in 2 different TextOption fields.
When we delete an authorizer from the system we need to fetch all persons and removed the deleted authorizer from the field. So I have implemted a event listener that listens to PersonDeleted and the I use dataService to fetch the customers that had the deleted person as authorizer assigned to it.
Problem:
When I execute my dataService I get the following exception:
No field with id 'Authorizer1' and operator 'eq'.
Isn’t it possible to search for persons by TextOption-field? In this case how can I solve it?
My implementation of the dataService:
List<Person> GetPersonsByFieldValue(string fieldId, string fieldValue)
{
using (var query = _dataService.CreateQuery<Person>())
{
var q = query.Filter(f =>
f.Bool(boolFilter => boolFilter
.Must(must =>
must.Field(fieldId, "eq", fieldValue))
));
return q.ToList();
}
}
Litium version: [7.4.2]