I have a process where I need to notify my CSO if a temporary access card has been out for a given amount of time, essentially a past due card. My calculation is below, but it doesn't work as expected. It never sets the flag to True.
import System static def GetAttributeValue(Request): Flag = 'False' if Request.Status.Name == 'Assigned': AssignedDate = Request.CreationDate TimeSinceAssigned = Request.GetBusinessTime(AssignedDate,DateTime.UtcNow) if TimeSinceAssigned.TotalHours > 10: if DateTime.Today.DayOfWeek != DayOfWeek.Saturday and DateTime.Today.DayOfWeek != DayOfWeek.Sunday: Flag = 'True' return Flag
When I run Test Calculation is get an error "Function not available at client" I understand from this document, Troubleshooting calculation error messages, that this is normal behavior. It appears that AssignedDate never gets set, therefore, TimeSinceAssigned never gets set and hence, my Flag never gets set to True.
Hoping someone can help and/or suggest how to troubleshoot.