Subject Re: Get . from OrderingItems
Author Rick Roen
Thanks Helen,

I fished around and came up with the following based on your tip in
case it is useful to anyone:

QualifiedFieldName :=
DMPO1.QItemHistory.OrderingField.RelName + '.' +
DMPO1.QItemHistory.OrderingField.FieldName;

Rick

--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 02:33 PM 13/01/2005 +0000, you wrote:
>
>
> >I have a routine that allows the user to select the ordering of a
> >query by clicking on the column header in an TIB_Grid fed by a
> >TIB_Query, and then select various modifiers so I can change the
> >SQLWhere in the query.
> >
> >I'd like to get the qualified <tablename>.<fieldname> of the
current
> >ordering so I can properly configure the where string into
something
> >like Query.SQLWhere = 'Where <tablename>.<fieldname> starting with
> >(or like or containing) '?''
> >
> >
> >I know I can get the OrderingItemNo, but I'm not sure how to
> >get "PURCHASEORDER.PONUM" from the OrderingItems when the
> >OrderingItemNo = 2.
> >
> >The orderingitems is like this:
> >
> >VNAME=VENDOR.VNAME;VENDOR.VNAME DESC
> >PONUM=PURCHASEORDER.PONUM;PURCHASEORDER.PONUM DESC
> >DATE_PO=PURCHASEORDER.DATE_PO;PURCHASEORDER.DATE_PO DESC
> >ITEMNUM=PO_ITEMS.ITEMNUM;PO_ITEMS.ITEMNUM DESC
> >ITEMNAME=PO_ITEMS.ITEMNAME;PO_ITEMS.ITEMNAME DESC
> >DATE_ETA=PO_ITEMS.DATE_ETA;PO_ITEMS.DATE_ETA DESC
>
> Well, OrderingItems is a stringlist so you could parse the
strings, I guess.
>
> It would be better to write a routine that gets back to the
RelationNames
> property of the Row object via the (unique) fieldnames of the
Fields[]
> array (which is also a Row object). The indexes of
ARow.RelationNames[]
> will correspond with the indexes of Fields[]. The OrderingField
property
> gives you a reference to the TIB_Column. OrderingItemNo tells you
which
> OrderingItem is current. OrderingLinks tells you which
tablename.fieldname
> maps to which OrderingItem (and don't forget that OrderingItems
number from
> 1, not zero).
>
> Helen