SetUserFilter
This function set filter for user field.
Syntax
SetUserFilter("FieldTitle", "FilterType", "FilterValues", ["SubDepartments"]);
Function arguments
- FieldTitle – (String) The user field title
- FilterType – (String) Could be „department” or „group”.
- FilterValues – (String) Department or group ids separated by „,” or „;”.
- SubDepartments – (Boolean) Set sub departments. Used only when filterType as „department”.
Return value
This function returns Boolean.
This function return true.
Examples
Example 1:
This will set users for user field „Employees” only from 2 groups: Administrators and Programmers.
SetUserFilter("Employees", "Group", "Administrators, Programmers");
Example 2:
This will set users for user field „Employees” from 2 departmets: Administrators and Programmers and sub departments.
SetUserFilter("Employees", "Department", "1, 2", true);