0

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

null
    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    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
    end

    Make sure to backup your database before trying.

    Steven

    • aussiemckenna
    • 4 yrs ago
    • Reported - view

    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!   

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    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))
    end

     

    Steven

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    note:

    i.datefieldincalender := appointment(datetime(number(i.importeddatefield)), datetime(number(importeddatefield) + 1000 * 60 * 15))

    is one line

Content aside

  • 4 yrs agoLast active
  • 4Replies
  • 1153Views