Release 10.1A: OpenEdge Development:
Progress Dynamics Administration

> ## Linking lookup fields directly to SDO fields on the viewer

> Linking the lookup fields directly to the SDO fields is the most direct way to map them, depending on how the lookup is defined in relation to the SDO.

> | To link the fields from the tutorial CustomerCodeLookup directly to the SDO fields:

> 1. Ensure that you have created a join from `art_order` to `arm_customer` in the `art_order` SDO (`artorfullo`) and added the following fields for the lookup from `arm_customer` to the SDO:

> - `customer_balance`
> - `customer_code`
> - `customer_name`

> For more information, see the "Preparing the lookup for field mapping" section.

> 2. After you have saved the updated SDO, open the `art_order` viewer (`artorviewv`) in the AppBuilder.

> 3. Drop the SDO fields for the lookup on the viewer using the DB Fields object from the Palette. The Multi-Field Selector for DB Fields lists the newly added SDO fields for you to select and add to the viewer.

> Note: After you drop the fields onto the viewer, one of them, the customer_name object, has the same label (Customer Name) as the CustomerCodeLookup.

> 4. Right-click on the CustomerCodeLookup and choose Instance Properties from the pop-up menu. This displays the SmartDataField Maintenance (Instance Properties) window.

> 5. In the query field browser, select the row for each of the lookup fields and type the column values as shown in Table E–2.

> Table E–2: Column values for lookup field mapping directly to SDO
> For Field name... | Set Link field to... | Set Linked widget to...
> --- | --- | ---
>     arm_customer.customer_balance
> | YES | customer_balance
>     arm_customer.customer_code
> | YES | customer_code
>     arm_customer.customer_name
> | YES | customer_name

> This is the SmartDataField Maintenance (Instance Properties) window as it appears after you have finished the field links (with customer_name scrolled out of view):

> 6. Save the instance properties to complete the field linkage.

> As noted in Step 3, using this option to map the lookup fields creates two redundant field objects on the viewer labeled Customer Name:

> - The CustomerCodeLookup on the `customer_obj` field from the SDO (`art_order`).

> - The customer_name fill-in from the SDO (joined to `arm_customer`).

> Both of these fields display the same value of `customer_name` as displayed or selected in the lookup. There is no way to complete the mapping of all lookup fields using this option without duplicating the display of that same field mapped from the SDO.

> Thus, this option linking lookup fields directly to SDO fields works best if the SDO field displayed in the lookup is the same as the viewer field on which the lookup is created. For example, you might use this option to map the fields of a lookup on the tutorial viewer for `arm_customer` (`armcuviewv`), where the lookup is created on the `customer_code` field, which already provides the value from the SDO for display in the lookup.

> For the CustomerCodeLookup example created on `customer_obj`, you can fix the redundancy for the user by permanently hiding the customer_name fill-in object used to map the lookup display field to the corresponding SDO field. However, you might prefer to use the second option for mapping lookup fields through separate viewer widgets mapped to the SDO.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095