List - FindReference Method

Find an object stored as a RelatedReference

Member of List (PRIM_MD.List)


Name Type Data Type Description
Result *Result (Optional) PRIM_MD.ListItem Reference to the first item containing the reference
RelatedReference *Input PRIM_OBJT Object to search for
StartItem *Input (Optional) PRIM_MD.ListItem Item at which to start the search


The FindReference method searches for the object specified in the RelatedReference parameter in the RelatedReference property of the List items.
FindReference processing will stop when an item is returned or no item is found.


In this example the found items are given a style to highlight them.
Mthroutine Name(Find)
Define_Map For(*Input) Class(#Prim_objt) Name(#Object) Pass(*By_Reference)
   Define_Com Class(#PRIM_MD.ListItem) Name(#FoundItem) Reference(*Dynamic)
         #FoundItem <= #List.FindReference( #Object #FoundItem )
         Leave If(#FoundItem *Is *Null)
         #FoundItem.Style <= #MyStylesHighlight

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020