0

Updating the appointment Field after inputing the date

Hi there,

Ive been trying to fine a solution to automatically repeat appointments weekly. Can't seem to come up with a solution so my next best idea was to have the appointment field automatically fill after the date field has been field. 

example

I click "Date" and put "todays date"

The appointment field below will automatically update to the same date + 11:45 Start and 12:30 finish.

Is this possible?

3 replies

null
    • Fred
    • 2 yrs ago
    • Reported - view

    I don't work with dates very much so this was a nice challenge.

    Here is one solution. You can try putting this in a button to test that it works:

    let dS := Date + time(11,45);
    let dF := Date + time(12,30);
    AppointmentFieldName := appointment(dS,dF)
    

    In line 1 and 2 you have to convert your time of 11:45 and 12:30 into data that Ninox can understand, so that is the time() function. Then we create a variable that stores the two different data.

    In line 3, we then tell Ninox to use the appointment function

    appointment(start date/time,end date/time)
    

    to set the start and end date/time of the appointment. Here we use the two variables from line 1 and 2.

    If it works like you want it to then you can put the code in the Trigger after update section of the Date field. You just have to be careful that if you change the date/time in appointment after it was first set, any future changes to Date will wipe out any changes to Appointment.

    I hope this helps.

    • Admin.11
    • 2 yrs ago
    • Reported - view

    Hi Fred,

    absolute legend that worked perfectly. I’ve got 4 other appointments on the same table for different times so I used your trick and repeated it 4 times with “+” in between each appointment.

    you wouldn’t have any idea if it’s possible to simply repeat the appointment automatically everyday?

    • John_Halls
    • 2 yrs ago
    • Reported - view

    Hi Admin

    Ninox doesn't have timed scripts (yet?). The best place to put something like that would be the Trigger after open. You could create a script that looks to see if the appointments have already been made and, if not, create them.

    Regards John

Content aside

  • 2 yrs agoLast active
  • 3Replies
  • 223Views
  • 3 Following