Przejdź do głównej zawartości

SetUserFilter

A SetUserFilter() function sets a filter for a chosen user-type field.

Warning: If this function is used in an automatic rule you should reset the filter if ForwardCase() function is also used.

SetUserFilter(FieldTitle, FilterType, FilterValues, [SubDepartments]);
  • FieldTitle – (String) a user-type field title/name;
  • FilterType – (String) could be „department”, „group”, „users” or „allusers”;
  • FilterValues – (String) department or group names or ids, or user logins, ids or e-mails, separated by „,” or „;”;
  • SubDepartments – (Boolean) set sub departments. Used only when filterType is „department”.

This function returns Boolean. This function return true.

This will allow to select users only from 2 groups: Administrators and Programmers in field „Employees”.

SetUserFilter("Employees", "Group", "Administrators, Programmers");

This will allow to select users from 2 departments: Administrators (id 1) and Programmers (id 2) and their sub departments in field „Employees”.

SetUserFilter("Employees", "Department", "1, 2", true);

This will allow to select users only from the given user list in field „Employees”.

SetUserFilter("Employees", "Users", "login1, login2@amodit.pl");

This will allow to select any user in „Employees” field.

SetUserFilter("Employees", "AllUsers");