Consultor Eletrônico



Kbase 20545: ADM2 - How to Sort SmartDataBrowse Records with RADIO-SET
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to sort records in a SmartDataBrowse (SDB) depending upon the value of the radio-set

FACT(s) (Environment):

Progress ADM2
Progress 9.x

FIX:

The following example code assumes that you have a smartwindow with a SmartDataObject (SDO), a SmartDataBrowser (SDB) and a radio-set on it. It also assumes that name of the radio-set is 'rsort' and that It has integer values as 1, 2, and 3. Add the following code to the 'value-changed' trigger of the radio-set:
DO:
DEF VAR pcSort AS CHAR.
CASE int(rsort:SCREEN-VALUE): /* rsort is the radioset name */
WHEN 1 THEN pcSort = 'custnum'.
WHEN 2 THEN pcSort = 'name'.
WHEN 3 THEN pcSort = 'city'.
END CASE.
DYNAMIC-FUNCTION('setQuerySort':U IN h_dcust, INPUT pcSort ).
DYNAMIC-FUNCTION('openQuery':U IN h_dcust).
END.