Dynamic color in calendar
I'm trying to set a formula that changes the color of an appointment on calendar.
I have the field FASE DI with this formula:
if 'Check-In' > Evento.Inizio then
styled("SMONTAGGIO", "orange", "", "")
else
styled("MONTAGGIO", "red", "", "")
end
So if I insert in the field SHOW AS of the Data
'Fase di'
I can see the label on the calendar with the right text and color
but I need to see more text infos in the label so I inserted
'Fase di' + " " + Evento.Evento + " - " + 'Nr. persone' + " persone"
I don't have any error in the formula but it doesn't appear like I will but so:
Maybe because the other fields hasn't the same color?
Is there a way out to make this works together without applying the color on the other fields?
Or maybe, is it possible to make a formula that set a different colorlabel in the calendar depending if DATE1 is before DATE2 of that record?
Thanks
7 replies
-
If you use styled, all the fields must be of the same type. For example a number and a text field won't work. You can use text(numberfield)+Textfield though.
Steven
-
PS: If you want to fill the dates between 'Check-in' Date and 'Check-out' Date in your calendar you need an appointment field. Let's assume your appointment fields name is 'Period' you can put something like this in the trigger after update of your 'Check-out' date field:
Period := appointment('Check-in','Check-out')
Steven
-
Thank you Steven!! I decided to remove the color from the field FASE DI? I've checked and it works but I need to see in red on the Calendar the reservations that have the check-out before the date of Start Event, otherwise in orange. Maybe it will be easyer if the color is Red when the result of the field FASE DI is MONTAGGIO or orange if not. Can you help me with the formula?
PS you saved me from a lot of work with the trigger of the PERIOD ;)
thank you for your help
-
Maybe this helps:
Steven
-
Thank you Steven! I will try in a week because I am away now! I let you know if this works
-
Hi Steven. I fixed the problem now.
I've putted on the period-field this formula in the field SHOW AS:
if 'Check-In' > Evento.Inizio then
styled("Smontaggio " + Evento.Evento + "-" + 'Nr. persone' + " persone", "orange")
else
if 'Check-In' < Evento.Inizio then
styled("Montaggio " + Evento.Evento + "-" + 'Nr. persone' + " persone", "red")
else
styled("Cancellato", "black")
end
endThank you for your help ;)
-
Content aside
- 4 yrs agoLast active
- 7Replies
- 1085Views