In this example, the Retrieve Record button and the list box are bound to the database (named DataConnection) shown in the Data View palette at the left. The button also has a FormCalc script attached to it to retrieve information based on the part number selected in the List Box field. The retrieved records appear in the ID, PART_NO, UNITPRICE, and DESCRIPTION fields.
Livecycle complex%20data%20binding%20pdf%20preview Using a button to populate fields from a database
2.
In the Data View palette, drag the UNIT_PRICE, DESCRIPTION, PART_NO, and ID elements under DataConnection onto the form design. Each node dragged onto the form design creates a bound field.
6.
Enter a FormCalc script similar to the following example. The script retrieves the data in the specified records and prints it in the corresponding fields when the user clicks the button.
$sourceSet.DataConnection.#command.query.select.nodes.item(0).value = Concat(“Select*from OfficeSupplies Where ID = “, DataListBox1.rawValue,””)
See also 

Using a button to populate fields from a database