Time field on createRecord

Posted by Rollbase User on 13-Apr-2012 04:07

I need to use createRecord and need to fill up Time field, how to do that? How should I format time prior to assignment to a Time field? This does not work: var arr=new Array(); arr["timefield"]=new Date().getTime(); rbv_api.createRecord("object1",arr);

All Replies

Posted by Admin on 25-Apr-2012 02:35

I'm curious about this now, too. Everything I pass into a time field seems to clear the value. If I invoke getFieldValue I get an object. Even if I pass that object back to setFieldValue , it clears the time field.



The object I get seems to be a JavaObject. I can't access all the properties of it:

>Error Access to Java class "java.lang.Class" is prohibited.

Posted by Admin on 25-Apr-2012 11:45

JavaScript getTime() returns date+time portion. You cannot use this function to set time opnly. You have to construct time value (number of milliseconds) using different way.

Posted by Admin on 25-Apr-2012 18:59

OK, thanks for that. - Nathan

Posted by Admin on 27-Apr-2012 06:11

Hi Pavel, can you suggest to us what those alternative ways are? We were searching the web but could not find the right solution for this.



Thanks in Advance.

Posted by Admin on 27-Apr-2012 13:27

This is actually a missing piece which will be filled in the next release. Time field should accept time as a string in user's format, like



"15:45" or "8:15 AM"

Posted by Admin on 29-Apr-2012 21:56

Thanks for the response Pavel..

This thread is closed