ADM2 sorting browse wit calculated field

HarryK

New Member
Hi,
I'm trying to develop some generic code for browsers
I found the code
on start search
DEFINE VARIABLE hDataSource AS HANDLE NO-UNDO.
DEFINE VARIABLE hColumn AS HANDLE NO-UNDO.
ASSIGN hDataSource = DYNAMIC-FUNCTION('getDataSource')
hColumn = SELF:CURRENT-COLUMN.
DYNAMIC-FUNCTION('setQuerySort' IN hDataSource, INPUT hColumn:NAME).
DYNAMIC-FUNCTION('openQuery' IN hDataSource).
when clicking on the column-heading of a calculated field i got an error 7328
Ok, fine, so no sorting on calculated fields, but i dont want an error either..
Since the code should be generic :) i have to find out "is this a calculated field"
In the SDO properties editor i can see there is no database or table connected to this field.
I added some code in the start-search trigger above
DEF VAR hRowObject AS HANDLE.
DEF VAR hField AS HANDLE.
{get RowObject hRowObject hDataSource} .
hField = hRowObject:BUFFER-FIELD( hcolumn:NAME ).
MESSAGE hField:TABLE VIEW-AS ALERT-BOX.
but this gives always 'RowObject' , even for the calculated fields

Anyone a solution how to get the database or table name of a browse column ?

Regards in advance,
 
Back
Top