
1810a.54142 (Customer) asked a question.
Workday syncs the terminationDate to OKTA and then OKTA updates the accountExpires attribute in AD - this following mapping works great: user.terminationDate != null ? Time.fromIso8601ToWindows(Time.fromStringToIso8601(user.terminationDate + " 22:00:00", "MM-dd-YYYY HH:mm:ss")) : 0
However, Workday does not clear the termination date when a user is Rehired. Need to add in a check if the terminationDate is greater then the hireDate.
User A: hire date 06-01-2025 terminationDate is blank - account expires should be set to 0
User B: hire date 06-01-2025 terminationDate 11-01-2025 - account expires populated with 11-01-2025
User C: hire date 06-01-2025 terminationDate 01-01-2025 - account expires should be set to 0
How can this be accomplished

@1810a.54142 (Customer) the expressions could possibly go deeper and time stamps can be checked as wel.
Below is one such example to check end date against start date.
user.endDate != null &&
Time.fromIso8601ToUnix(Time.fromStringToIso8601(user.endDate, "MM-dd-YYYY"))
>
Time.fromIso8601ToUnix(Time.fromStringToIso8601(user.startDate, "MM-dd-YYYY"))
? 1: 0
If endDate is not null, compare it with startDate.
If endDate is greater than startDate, 1
Otherwise, return 0 (no expiration)