Consultor Eletrônico



Kbase P46560: ADM2: How to Sort a SmartDataBrowser
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

ADM2: How to Sort a SmartDataBrowser

GOAL:

This solution explains how to sort records in a SmartDataBrowse (SDB) depending upon the value of the radio-set.

FIX:

The following example code assumes that you have a smart window with a SmartDataObject (SDO), an 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.