Skip to content

Commit 3d7ca79

Browse files
authored
Update Locked Out field when Active field changes on User record (#1144)
1 parent 4b65819 commit 3d7ca79

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use Case <br/>
2+
As per OOB, the "Locked out" field will be set to true if Active field set to false. But, the vice-versa case is not implemented. For example, If Employee is on long leave like maternity leave etc., then the user account will be set inactive temporarily and reactivated upon his/arrival to office. This causes, user account to be Active and Locked out as true which makes the login to fail
3+
# Business Rule <br/>
4+
Name: Update Locked Out field<br/>
5+
Table: User [sys_user] <br/>
6+
Advanced: true <br /><br/>
7+
8+
**When to run section:**<br/>
9+
When: Before <br/>
10+
Insert: true <br/>
11+
Update: true <br/>
12+
Filer Conditions: Active -- Changes to -- true [AND] Locked out -- is -- true<br/><br/>
13+
![image](https://github.com/user-attachments/assets/835f6d9c-8d60-4b1a-9159-bda5576fe088)
14+
15+
**Advanced section:**<br/>
16+
Script:<br/>
17+
(function executeRule(current, previous ) {
18+
19+
current.locked_out = !current.active;
20+
21+
})(current, previous);
22+
23+
![image](https://github.com/user-attachments/assets/0fd67e77-38f3-449d-9647-047406f8d23e)
24+
25+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(function executeRule(current, previous /*null when async*/) {
2+
3+
current.locked_out = !current.active;
4+
5+
})(current, previous);

0 commit comments

Comments
 (0)