Expand my Community achievements bar.

SOLVED

Filling other fields based on a dropdown box

Avatar

Level 1

Hello,

I'm completely new to LiveCycle and am just beginning to teach myself how to use it.

Essentially what I want to do speed up the filling of a purchase order form by causing it to fill itself out based on what is put into other fields.

For example, I would like our usual suppliers to be listed in a drop down box (I know how to do this, at least), and then have the address fields filled out automatically.

I realize I can do this using javascript, but this is rather inconvenient because I don’t want to sit there putting 276 suppliers into my script. In addition, I don’t want to have to edit the script every time we want to add a new supplier.

Is it possible to build a form that does this and can pull info off some other file or database? Also, I would like to make it fairly idiot-proof when it comes to adding new suppliers.

Thanks,

Darryl

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The way to do this is to hook up the drop down to a web service and have the web service return the list of suppliers (at form load) . Once the user selects a supplier a second web service woudl pull the information and populate the appropriate fields.  This technique is easiest to configure on the client machines (as all information is contained within the form). You will have to get another piece of software called LiveCycle Reader Extensions server to allow the form to make web service calls from Reader (assuming Reader is being used).

The form can connect to a DB directly but that solution has drawbacks as well. You will have to configure a dataconnection on each machine as well the machine must be on the same network as the DB. This will only work on Windows machines. You will also need to Reader Extens to allow DB connections with Reader.

Hope that helps

Paul

View solution in original post

6 Replies

Avatar

Correct answer by
Former Community Member

The way to do this is to hook up the drop down to a web service and have the web service return the list of suppliers (at form load) . Once the user selects a supplier a second web service woudl pull the information and populate the appropriate fields.  This technique is easiest to configure on the client machines (as all information is contained within the form). You will have to get another piece of software called LiveCycle Reader Extensions server to allow the form to make web service calls from Reader (assuming Reader is being used).

The form can connect to a DB directly but that solution has drawbacks as well. You will have to configure a dataconnection on each machine as well the machine must be on the same network as the DB. This will only work on Windows machines. You will also need to Reader Extens to allow DB connections with Reader.

Hope that helps

Paul

Avatar

Level 1

Thanks,

I'll look into setting this up. Seems I may need more help that I expected... will have a word with our IT consultants.

Avatar

Level 2

What about a simpler scenario? – Please see the attachment.

I have a drop down list with two options “A” / “B” and an empty text box.

When the user chooses “A”, I want “AAA” to appear in the empty text box
When the user chooses “B”, I want “BBB” to appear in the empty text box

What’s the simplest way to accomplish this?

Thanks,

Yaniv

Avatar

Former Community Member

Here is a modified sample. I added the ability for the dropdown to have one value to show the user (A) but report a different value for the data (AAA). Then I added code to the exit event of the dropdown to change the Text value.

Paul

Avatar

Level 2

Thank you!

I am unable, however, to download your attachment. Could you please reattach it?

Yaniv

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----