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.

Creating separate forms from Database

Avatar

Level 2

I'm using Acrobat 9.1.2 and LiveCycle Designer ES ver. 8.2.1x.

I have an MS Access database populated with names/info regarding various people (Customers).  I'm trying to create/generate separate (Order) forms, one for each Customer, each pre-populated with the Customer's contact information from the database.  I want to e-mail each customized form to each Customer.

Each Customer should be able to change/correct inaccurate Customer information on the form (set control "Type" to "Calculated - User can override"?).

Each form will also have a table containing various "Products" (not connected to the database) and drop-down list controls from which each Customer can select the number/quantity of each Product he/she wants to order.  Price extensions, subtotals, and totals are all calculated using FormCalc.

The Customer will then be able to both "Submit by e-mail," and "Print" and return the form by mail with his/her payment.  I will then collect/assemble the returned .xml files and import them into the MS Access database myself.

Where I'm hung up is when I connect the Order form to the database, only one form is created, and only data from the first record appears in it.  How do I create one form for each Customer from the database?

You can e-mail me at bryancapps@cfl.rr.com.

7 Replies

Avatar

Former Community Member

The form can only display one record at a time. You can add controls to your form that will allow you to navigate through the records. Add the following buttons to aid in navigation:

Next

Previous

First

Last

On the click event of each button add the code to perform the appropiate action (assuming you have named your connection DataConnection:

xfa.sourceSet.DataConnection.next();

xfa.sourceSet.DataConnection.previous();

xfa.sourceSet.DataConnection.first();

xfa.sourceSet.DataConnection.last();

Test it.

Paul

Avatar

Level 2

Thanks, Paul, for advice on putting navigation buttons on the form.  I'm familiar with that, and might be able to use that in the future on another project.   In this instance, that's not the problem though.  From your answer, it sounds like what I'm trying to do is not doable. (?!)

If I were creating this form in, say, MS Word, I could insert merge fields tied to the database data, and merge the form to separate pdfs/forms, each one populated with Customer info from the Access database.  No problem.

Could I maybe then run a Javascript to insert the Order form data as a fragment into each of the generated pdf/forms?

Other insights welcomed.

Bryan

Avatar

Former Community Member

Are you trying to display all records in the DB in a single form? Each line woudl represent a record in the DB?

Paul

Avatar

Level 2

No, not all records on one form, but one record per form.

Avatar

Former Community Member

So I am still unclear as to what you are looking for .....maybe a couple of images would help.

Paul

Avatar

Level 2

OK, see attached.  It's a high-school reunion registration form.

Intent is to pre-populate the fields (in the form's header--there is no data yet in the fields represented by the table), generate 1 form per alumni, and e-mail to them.

Avatar

Former Community Member

So each record in the DB represents a separate instance of the form to be mailed out to someone.....right?

Normally that level of functionality is done server side but there is one reason why you may not want to do this clicent side. Let me explain. You woudl have to write an automation script that woudl retrieve each record from the DB. Once a record is retrieved you coudl automate the mail of the doc , then get the next record and mail ...etc...until all records are done. All of this is possible except for the sending of the email. Acrobat/Reader will allow you to create the email message and control all aspects of it, but it will not allow you to send an email without the user hitting the send button. So if you want to have the mail generated, then hit send after every instance then it could be done.

If you do this using server products then this is not an issue and can be easily done, but note that the cost of the server products will make the solution out of reach for all but the company's that do mass mailings or e-statements etc.

Hope that helps

Paul