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.
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 |
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, and you will see that Unit Price of the product has been copied into the order detail.