Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Updating database with expandable table

Avatar

Level 1

Hi All,

I’ve designed a simple time sheet for our work, the worker basically fills out their name, week ending, then goes to a table with date picker, the hour started and finished. The next field automatically calculates their hours and overtime if it applies. There are also text fields to describe the job location and description.

I then have a button to add a row to make another entry, because they may be half day at one job and half day at another. They can continue to add rows until they have filled out the whole week’s work.

I have the form connected to an access database with each field in the row bound; an update button to update the new record that was inserted into the database when the form was opened using this scripted in form1 form:ready:

xfa.sourceSet.DataConnection.addNew()

When the user enters one entry and updates, this works perfectly.
When the user clicks to add a new row, the new row contains the data of the first row and when you change one, it changes the other.
When I set the data bindings to incorporate the [*] wildcard, then the new row is empty.
Before:
$record.DataConnection.Start
After:
$record.DataConnection.Start[*]

The problem that I’m running across now is that the update button will only update the info in row[1] and not add the info in row[2].
I set the following command on the click event for when the table has a new row added:


xfa.sourceSet.DataConnection.addNew()

but this didn’t work.
I’m kinda at a loss now what to do, all I need is for the form to be able to add multiple records to the database with one button without having to open it and add each entry separtately.
Does LiveCycle support multiple fields with the same name in a dataconnection?
Eg. Hours[1]
Hours[2]

I've attached the form for viewing

Thanks in advance!
Justin

2 Replies

Avatar

Former Community Member

The DataConnection can only deal with 1 record at a time ....there is no concept of a recordSet.

Paul

Avatar

Level 1

Hi all,

I know this is a very old threat but has anybody found a solution to this yet?

I've managed to pull SQL data into a expandable table through a looping and add new row script. On top of that, my script already has a form of binding to the appropriate cells (so, my cell doesn't have a binding). However, I'm not able to find a solution to update it back accordingly. Any ideas?

Ken