Saturday, March 10, 2012

Order Details: Configuring Lookup Fields

Let’s make similar changes to the Order Details controller. We’ll make the ProductID lookup open in search mode upon creating a new order detail. When selecting a product, the Unit Price will also copy over into the order detail.

Switch to the Designer, and expand to Order Form / c100 / dv101 / createForm1 / c1 – New Order Details / ProductID / ProductID. Double-click on the the ProductID field reference.

ProductID field node in Code On Time web application Designer

Change the following settings:

Property Text
Data Value Field ProductID
Data Text Field ProductName
Copy UnitPrice=UnitPrice
Search on Start True
Activate if Blank True
Lookup window description Select a product

ProductID Lookup configuration in Code On Time Designer

Press OK to save the field, and press Generate in the top left corner. Wait until the Preview window refreshes with the regenerated web application.

Navigate to the Order Form page, and select any order.

A lookup will open prompting you to select a product.

'Select a product' lookup in Code On Time web application

Select a product, and you will see that Unit Price of the product has been copied into the order detail.

New Order Details screen in Code On Time web application

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.

© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at