Contextualizing: I have a system that changes the fill of an icon to green and yellow in 3 conditions, daily, weekly and monthly. This condition applies from records saved in a list, which are answered in a form, which some of these records are monthly, daily and weekly...
Problem: The daily subtracts the label9 (date the records were released), turning green while it counts 24 hours to turn yellow, the weekly counts 168 hours to turn yellow, and the monthly counts 720 hours to turn yellow.
and I need to make a change in this system, for it from the saved record and taken in label9, instead of counting 24, 168 and 720 hours from the saved record, leaving the yellow fill on the same date!
Ex:
Diary turns yellow 8:00 A.M every day
Weekly turn yellow every Monday at 8:00
Monthly turn yellow every 1st of every month
I believe I have only one detail to modify, but I haven't found a way yet
my code:
Switch( ThisItem.Frequencia; "Diario"; If(DateDiff(DateTimeValue(Label9.Text);Now(); TimeUnit.Hours) < 24; Color.Green;Color.Orange); "Semanal"; If(DateDiff(DateTimeValue(Label9.Text);Now(); TimeUnit.Hours) < 168; Color.Green;Color.Orange); "Mensal"; If(DateDiff(DateTimeValue(Label9.Text);Now(); TimeUnit.Hours) < 720; Color.Green;Color.Orange) )
Diario = Daily
Semanal = Weekly
Mensal = Monthly
ThisItem.Frequencia = frequency (monthly, daily, weekly)

Report
All responses (
Answers (