| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > Code Templates > [[tplcodeinitiatethread.htm|InitiateThread code template]] >====== Lookup Non-Related Record code template ====== | [[tplcodeinitiatethread.htm|{{btn_prev_n.gif|Previous page}}]][[tplcodeinitiatethread.htm|{{btn_home_n.gif|Return to chapter overview}}]][[tplcodeprocesstransactionframecheckpoint.htm|{{btn_next_n.gif|Next page}}]] | | || The LookupNonRelatedRecord template is used to perform a lookup of a value based on a relationship, whether it is or is not defined in the data dictionary (Ad hoc relation). You can add this Code template to the Lookup Up Related Records embed point. | **Lookup Key** | Type in the key name or press the ellipsis (...) button to select the key from the **Select Key** dialog. | | | The lookup key is used to perform the lookup into the lookup file. This //must// be a unique key. If the key is a multi-component key, the other key elements must be primed before executing this Code template. | | **Lookup Field** | Type in the field name or press the ellipsis (...) button to select the field from the Component list. | | | The Lookup Field must be a component of the Lookup Key. This is the unique value within the lookup file. | | **Related Field** | Type in the related field or press the ellipsis (...) button to select it from the **Select Column** dialog. | | | The Related Field provides the unique value used to perform the lookup. | This template generates code similar to the following: **ST:StateCode = CUST:State       ! Move value for lookup** **Access:State.Fetch(ST:ByCode)   ! Get value from file**