This function will return all the items from given section and field into an array so you can use the infromation a bit like in DS 1.x.
Call this function like
LET MyBrandNewArray = IHSGetAllItemsFrom("Detail1", "ItemNumber")
or use it directly in the content property of a field on the format. You can find the content property by clicking on a field the Click on properties, the on the bottom of the window select 'runtime' and if the field is a dynamic field (a T with a question mark) you will see the Content property.
Use the function like :
= IHSGetAllItemsFrom("Detail1", "ItemNumber")
assuming you have both a section Detail1 and a field called ItemNumber
, the variable MyBrandNewArray
will contain all the values from every instance.
Save this as function as a text file in the fun folder as IHSGetAllItemsFrom.fun
FUNCTION "IHSGetAllItemsFrom" ACCEPTS gaif_Section, gaif_Field DESTROY gaif_Result FOR gaif_Counter=1 TO NODECOUNT(Layout,gaif_Section) LET gaif_Result[0] = VALUE("Layout." & gaif_Section &"{"&gaif_Counter&"}."&gaif_Field) END FOR DESTROY gaif_Section, gaif_Field, gaif_Counter RETURN gaif_Result END FUNCTION