These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Date/Time Field Error

bctflex
Registered: Aug 8 2008
Posts: 37
Answered

Hello,

I have created a 4 page form with Livecycle 8.1 which pass data to a SQL Server 2005 database via ODBC. On the bottom of each page is a submit button coded --> xfa.sourceSet.WrkComp.update() which updates the form through a click event.

There are numerous global fields on the form. There are two in particular which are raising an error. They are date/time fields. Both are configured with following settings the second field is set to Read Only.

Binding Tab
Default Binding = Global
Data Pattern = Time.Short{}
Data Pattern = Time

Field Tab
Type = Date/Time Field
Display Pattern = Time.Short{}
Edit Pattern = Blank

When I enter time to the first field in military time like 1401, 1536, or 2355, the desired time 2:01 PM, 1:36 PM, or 11:55 PM is displayed correctly in both fields and I am able to click the submit button and update form and the database. However, when I enter the time like 1400, 1500, or 2300, abd click the submit button, an error is raised with the following message:

Error: updateRecord operation failed. Multiple-step operation generated errors. check each status value.[timeOfAccident:2]

I am puzzled to why time entered in whole hours will create the error while time entered with hours and minutes does not. Has any one encountered this problem?

Thanks

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It's a matter of formating. It's the DB that's sending back the error. This is not not an Acrobat or LiveCycle issue. The field in the DB expects the data to be formatted in a specific way, and the data that is being sent is formatted in a different way. If you want the DB to accept a variety of formats then set the DB field to text.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

bctflex
Registered: Aug 8 2008
Posts: 37
Hmmm...

I was looking at the database design and actually changed the field to text temporarily yesterday. I will take a more indepth look at it again.

Thanks Thomp
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There was an important point that I missed. Your date field is set to global binding. If this is true then it is not connected to the database operation. There must be something else going on here.

Is the global field named "timeOfAccident"? Is there some other date field bound to the DB? How is data getting from the visible (global) field to the DB bound field?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

bctflex
Registered: Aug 8 2008
Posts: 37
Thomp --> Is the global field named "timeOfAccident"? Yes There are no other time fields on the form. I checked for errors in binding.I changed the database field to text and the data is being passed correctly. All is well. 1400 hours look like 14 and 1536 is passed as 15:36 which fine.