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.
On the Controllers tab of the Project Explorer, double-click on OrderDetails / Fields / ProductID (Int32) –> Products field node.
Change the following settings:
|Property ||New Value |
|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 Browse in the top left corner.
Navigate to the Order Form page, and select any order. Create a new order detail record. 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.