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.

Select Specific Database Records from Within a Form

Avatar

Level 2

I'm trying to find an example of a simple form that has one text box, a button (that retrieves from the database) and one

additional field that will populate with information that was retrieved from the database based on the information entered into the text box.  I've been unable to find a SIMPLE example of this.  It can't be as complicated as it seems.  I just want to enter an id, click the button, retrieve data from the database based on the id and display one column of retrieved info on the form.  CAN ANYONE HELP ME, PLEASE?

4 Replies

Avatar

Former Community Member

Here is a link to a blog entry that describes how to use a value derived from a DDlist to formulate a query and retrieve a record from a DB.

http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/

Paul

Avatar

Level 2

Thanks Paul, but I've already read this article.  I don't want to use a DDlist.  I want to incorporate a free-form text field where a user can enter an ID and then have the form query the database for that specific ID and ultimately return the rows of data to the form (where it can be modified and re-written to the database).  The DDlist is impractical when trying to work with a table that has tens of thousands of IDs.  I've worked with many forms tools before that all make connecting to a DB very easy.  Designer doesn't make it easy to accomplish something that should be very simple.  Thank you, again, however, for your reply.

Kim

Avatar

Former Community Member

Understand but it doesn't matter ...the technique that is used is the same in that a user will enter information (whether it is a DDLsit or a field) and that value gets put into a SQL statement to extract data from the DB. In your case you will use the exit event of the field and the rawValue of the field in the SQL statement ...everything else is the exact same.

Paul

Avatar

Level 2

Tried that, but it didn't work.  I will try again later today.

Thanks again.