Skip to content

Commit 0acaa83

Browse files
Create README.md
1 parent 126f76c commit 0acaa83

File tree

1 file changed

+18
-0
lines changed
  • Server-Side Components/Script Includes/DepartmentFilter

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Department Filter – Show Only Users from Same Department
2+
3+
This Script Include is configured to filter users based on the department of the currently logged-in user.
4+
5+
It can be used in a **Reference Qualifier** to ensure that the Caller (or any user reference field) displays only users belonging to the same department as the logged-in user.
6+
7+
### 📘 Table
8+
- `sys_user` (to fetch users)
9+
- Used for reference fields such as `caller_id` in `incident`
10+
11+
### ⚙️ Script Include Overview
12+
- Name: `getSameDeptUsers`
13+
- Function: `getSameDept()`
14+
- Logic: Fetches all users whose `department` matches that of the current logged-in user.
15+
16+
### 🧩 Example Usage (Reference Qualifier Script)
17+
```javascript
18+
javascript:new getSameDeptUsers().getSameDept();

0 commit comments

Comments
 (0)