Subject Re: please help with FieldsDisplayLabel and OrderingLinks
Author Michael Fung
Thanks Marco,

I already corrected the OrderingItems, sorry I did not state my
problem specific enough. The problem is in the OrderingLinks. It
doesn't work if I enter "B.NAME=Item=1" or "Brand.NAME=Item=1", the
sort glyph won't show up. If I enter "NAME=Item=1", then all three
columns are sorted together which is not I wanted. It seems
OrderingLinks does not distinguish same column names from different
tables.

Any idea?

Thanks again,
Michael



--- In IBObjects@yahoogroups.com, "Marco Menardi" <mmenaz@l...> wrote:
> --- In IBObjects@yahoogroups.com, "Michael Fung" <ibo@c...> wrote:
> > Dear all,
> >
> > I used IB_Connection.FieldsDisplayLabel to set the grid column
title
> > globally, like that:
> >
> > Brand.Name=Brand
> > Category.Name=Category
> > Currency.Name=Currency
> > Package.Name=Package
> > Unit.Name=Unit
> >
> >
> > It worked like a charm. So I didn't bother to name the fields in
all
> > queries, like that:
> >
> > SELECT P.ID
> > , P.PN
> > , B.NAME
> > , K.NAME
> > , C.NAME
> > , P.PHY_QTY
> > , U.NAME
> >
> > FROM PRODUCT P
> > LEFT OUTER JOIN BRAND B ON B.ID = P.BRAND_ID
> > LEFT OUTER JOIN PACKAGE K ON K.ID = P.PACKAGE_ID
> > LEFT OUTER JOIN CATEGORY C ON C.ID = P.CATEGORY_ID
> > LEFT OUTER JOIN UNIT U ON U.ID = P.UNIT_ID
> >
> > However, when I come to setup Ordering for the queries, it
doesn't
> > work becuase of the same 'NAME' fields!
> >
> > Is there a workaround? Could you save me from rewriting all
qeries,
> > please?
> >
> > TIA,
> > Michael
>
> This is a problem not related with FieldsDisplayLabel, it's that you
> must provide to Firebird a NON AMBIGUOUS field reference.
> So in OrderingItems you must provide table names too, like:
> NAME=C.NAME
> BRAND NAME=B.NAMEor whatever you like.
> To check what ibo does, use the SQL monitor and have a look at the
> query generated when you change OrderingItemNo. If you see a "ORDER
BY
> <ambiguous fieled name here>" you know that Firebird will reject it.
> In addition, as a free suggestion, consider that if you make
> intelligent use of domains, there is the wonderful possibility to
> define a lot of properties related to domains at the IB_Connection
> level, to gain a lot of time, consistency and error free
developement.
> regards
> Marco Menardi