Time fields weird behaviour in Server Side formulas

  • Thread starter Thread starter romain.pennes@foederis.fr
  • Start date Start date
Status
Not open for further replies.
R

romain.pennes@foederis.fr

Guest
Hello, In Rollbase, it is possible to create "Time" type of Fields. Those allow the user to set a time (hour and minutes) in a day. When trying to manipulate this kind of fields in Server-Side formulas/triggers, we get a weird behaviour using the "rbv_api.getFieldValue" and "rbv_api.setFieldValue" functions. - The "rbv_api.getFieldValue" function returns an integer which corresponds to the number of milliseconds between 0:00 and the time that has been set in the field. - The "rbv_api.setFieldValue" function doesn't work when giving it an integer with milliseconds. It only works when set with a string of the "HH:mm" form. We find this behaviour to be wrong. I think the "setFieldValue" function shall work when given milliseconds in parameters since it works this way with the getFieldValue function. Nothing is mentionned in the "Rollbase In Action" documentation, so we had to experiment by ourselves: rbv_api.getFieldValue("task28", {!id}, "start_time"); // Returns 34200000 rbv_api.setFieldValue("task28", {!id}, "end_time", 34200000); // Does nothing (Fields stays empty) while it should set time to be "09:30" rbv_api.setFieldValue("task28", {!id}, "end_time", "09:30"); // Sets Time to be "09:30" Could you had the possibility that the "setFieldValue" function also work with the milliseconds form? If not possible, could you add a function to transform milliseconds 34200000 to string "10:30"? We shall do that ourselves in the meantime. Thank you ! Romain.

Continue reading...
 
Status
Not open for further replies.
Back
Top