List View Item - RelatedReference Property

Reference to an object instance to be stored for this item

Member of List View Item (PRIM_LVIT)

Data Type - PRIM_OBJT - Base object, use it as the ancestor of components which are not visualized

Details

Lists typically have a simple correlation between the visible item and some kind of underlying data object e.g. A list of customers, employees or orders.
 
Rather than relying on the field values in the list to manage the related data, or using a dictionary collection to store the link between the list item and a data object, RelatedReference provides a convenient, generic storage point that joins the list item to its data object.

Example

In the AddEmployee routine, a data object is stored against a list item.
 
In ItemGotFocus event, the RelatedReference is retrieved and used to populate a detailer of some sort.
Mthroutine Name(AddEmployee)
Define_Map For(*Input) Class(#DataEmployee) Name(#Employee) Pass(*By_Reference)
 
   Add_entry To_list(#List)
   #List.Currentitem.RelatedReference <= #Employee
 
Endroutine
 
Evtroutine Handling(#List.ItemGotFocus)
 
   #Detailer.ShowEmployee((#list.CurrentItem.RelatedReference *as #DataEmployee))
 
Endroutine

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2