Formula outcome in the calendar
Hi hoping someone can help with a problem that has me stumped. I am importing a CSV file that has a date field on there but it is poorly formatted. I am using a formula to translate that into a date but as its a forumla field, there isn't the option to show in the calendar. I've tried using an "after update" event on another field in an attempt to copy the formula outcome into a native date field (which will show on the calendar), but this doesn't run when I'm import a new file. Can anyone help? It would be much appreciated as I think I've tried everything!
4 replies
-
You can use the console or a button for that since triggers won't fire on importing. Afterwards you can delete the button.
Something like this:
for i in select yourtable do
i.datefieldincalender := i.importeddatefield
endMake sure to backup your database before trying.
Steven
-
This is great, and does the trick Steven - thank you! It adds as an all day appointment though when importeddatefield has a time too. Do you think its possible to add as an time specific appointment? I'd like to have an appointment going from importeddatefield (which actually contains a time too) to importeddatefield + 15 mins...? Pushing my luck a bit now i know!
-
First, is your importeddatefield of the Date/Time type(You should see a date and the time in that field: 06-02-2020 12:00 )? datefieldincalender must be of Appointment type.
"15" in the last line stands for 15 min.
for i in select yourtable do
i.datefieldincalender := appointment(datetime(number(i.importeddatefield)), datetime(number(importeddatefield) + 1000 * 60 * 15))
endSteven
-
note:
i.datefieldincalender := appointment(datetime(number(i.importeddatefield)), datetime(number(importeddatefield) + 1000 * 60 * 15))
is one line
Content aside
- 5 yrs agoLast active
- 4Replies
- 1160Views