Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Automatically populate customer information from an ID number

Updated: 21 May 2010 | 4 comments
JAguiar626's picture
0 0 Votes
Login to vote

I'm building a form that pulls customer information from our database.  We would like to use the AutoCompleteTextBox component for the 5 digit customer ID.  When the ID is selected, we would like the Customer name and address fields to be automatically populated.  What is the best way to approach this?

Comments

stuper2's picture
18
Sep
2009
1 Vote +1
Login to vote

Re: Automatically populate customer information from an ID numbe

Here's the easiest way to do this:

  1. Add a "lookup" link button comp right next to the AutoComplete textbox
  2. The exit path leaves the form, looks up the customer name and address fields, then returns to the form and populates the fields

Here's the harder way to do this:

  1. Open the editor for the AutoComplete textbox and turn on the "Post Form on Value Change" (under functionality tab)
  2. Open the editors of the two display components (for name and address) and set their values to dynamic model.
  3. In the dynamic models, use a variable exists component to check if the ID text box has value. If yes, add your database lookup to retrieve name and address from database.
  4. Map the end comp in the dynamic model to expose the data

This second configuration is harder but it makes it so the user doesn't have to click a button.


JAguiar626's picture
24
Sep
2009
0 Votes 0
Login to vote

Hey Thanks Stuper,It

Hey Thanks Stuper,

It definately helped point me in the right direction, but with your first option i'm not getting the right return.  In the array return values, i only have options for First and Last.  So what i did was created 2 query components. 1 for just the customer ID's (used in the autocomplete) and the 2nd for customer information (including id number) which is used on the exit path look up.  When i go into the text boxes for name&address I only see the first and last array values. any ideas?
autocomplete.jpg

Dalceon's picture
28
Sep
2009
0 Votes 0
Login to vote

I have had difficulty in the

I have had difficulty in the past getting textboxes to update without leaving the form and coming back.
The reason you're only getting first and last is probably because a text box can only have a single value and not be an array.
If you want to address the array, you'll have to add that info into another selection form.  If the ID numbers are unique, then
use first or last, they should always bee the same.

If you want the info to change on option 2, you'll probably have to switch the textboxes to labels and store the values somewhere else.

This make sense?

JAguiar626's picture
28
Sep
2009
0 Votes 0
Login to vote

Thanks Dalceon...  I did get

Thanks Dalceon...  I did get this working using the first option.  i'm going to post a document on how i did it at somepoint this week.