Timestamp not showing in form field with new LO MySQL ver.

Discuss the database features
Post Reply
dvmad
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

Timestamp not showing in form field with new LO MySQL ver.

Post by dvmad »

Currently using LibreOffice Base as a front end with a MySQL engine. A form has a visible field for a timestamp. In our previous setup using LOBase 4.2.8.2 with MySQL 5.6.22 with the following line in the table creation:

‘mos_dt’ timestamp NOT NULL DEFAULT CURRENT TIMESTAMP,

While adding a new record, hitting the save button would have the datetime pop up in the field and the record would save properly.

Our current setup is using LOBase 5.3 with MySQL 5.7.20.

Now when trying to save a new record in the form, the field does not fill and an error message that the field must be filled pops up. I can add a new record through the table and when hitting the save button the datetime shows and the record saves fine as with the previous setup. One clue that might be affecting this from the MySQL 5.7 manual is: “in MySQL 5.7, timestamp is a DOUBLE rather than BIGINT because its value includes a microseconds part”.

Any thoughts? Thanks.
Paul
ubuntu 14.04
openoffice 4.2
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Timestamp not showing in form field with new LO MySQL ve

Post by Villeroy »

What happens when you make the time stamp in MySQL nullable?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dvmad
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

Re: Timestamp not showing in form field with new LO MySQL ve

Post by dvmad »

I haven't tried accepting nulls in MySQL for that field (or any other field, nulls are too mysterious). The MySQL back end is functioning well and mission critical, so I don't want to experiment there. We have decided for now we don't absolutely need to see the timestamp on the form, just sort on it so have removed it.

Should this be marked solved?
Paul
ubuntu 14.04
openoffice 4.2
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Timestamp not showing in form field with new LO MySQL ve

Post by Villeroy »

Do you see menu:Edit>Database>Advanced Settings>"Form data input checks for required fields"? If so, turn that off. The form will no longer care about required fields. This has some side effects on how the frontend reacts on errors (not at all).

The form can not show any values that have not been stored yet. A pair of time stamp controls shows the stored value of an existing record. It needs to show null for a new record since it is unkown when (and if) it will be stored. For a running clock on the form you may implement something with a time field or a macro or both.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dvmad
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

Re: Timestamp not showing in form field with new LO MySQL ve

Post by dvmad »

The "Form data input checks for required fields" checkbox is available in libre office 4.2.8.2, the previous version I was using. It is no longer in the advanced settings in libre office 5.3. I have looked to see if I could find that checkbox elsewhere in 5.3 to no avail.
Paul
ubuntu 14.04
openoffice 4.2
eremmel
Posts: 1080
Joined: Tue Dec 30, 2008 1:15 am

Re: Timestamp not showing in form field with new LO MySQL ve

Post by eremmel »

dvmad wrote:We have decided for now we don't absolutely need to see the timestamp on the form, just sort on it so have removed it.
Paul
The Base forms are used for viewing and data entry, but it is also common to have dedicated data entry forms and more complex data view forms.

I guess an escape might be to put the date on a sub-form. The save operation will only work on the main form and after saving the sub-form will be updated with the date populated by the database.
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
Post Reply