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

Discuss the database features

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

Postby dvmad » Mon Jan 22, 2018 3:53 pm

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
dvmad
 
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

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

Postby Villeroy » Tue Jan 23, 2018 11:25 am

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, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 25956
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby dvmad » Tue Jan 23, 2018 3:43 pm

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
dvmad
 
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

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

Postby Villeroy » Tue Jan 23, 2018 4:53 pm

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, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 25956
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby dvmad » Tue Jan 23, 2018 9:30 pm

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
dvmad
 
Posts: 7
Joined: Thu May 26, 2016 7:22 pm

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

Postby eremmel » Tue Jan 23, 2018 11:09 pm

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.
Is your question answered: edit your initial post add "[Solved]" to the subject and check V
LO4.2.8 for work with ORB; AOO4.1.4,LO5.2.5/6.0.5 on W7E SP1 64bit
It's Microsoft marketing that tells you computers are qualified for non-technicians
User avatar
eremmel
Volunteer
 
Posts: 1016
Joined: Tue Dec 30, 2008 1:15 am
Location: Barneveld, Netherlands


Return to Base

Who is online

Users browsing this forum: No registered users and 4 guests