I have an object which stores the employee name and role.
<model name="employee" label="Employee">
<field name="first_name" label="First Name" type="text:name" />
<field name="role" label="Role" type="multiple-choice">
<option key="admin">Administrator</option>
<option key="driver">Driver</option>
</field>
<display>{first_name}</display>
</model>
Some users are drivers, some admin and some both. I created a procedure in the sharedJS folder to return all drivers based on the role.
function sharedLookupDrivers() {
return DB.employee.where("role = ? ", "driver").orderBy("first_name").toArray();
}
I am having issues returning all the drivers, since the role field is a multiple-choice and I cannot indicate in the filter that I need to return all object where 'driver' is selected. I have tried other methods of applying the filter but I cannot return all employees where 'driver' is selected.
Can you please advise how I can select objects where the role has 'driver' selected?"