* Get next customer LPARAMETERS piDataSession * accept the data session id from the calling form LOCAL liDataSession, lcAlias * Save the current data session id liDataSession = SET("Datasession") * Change to the data session of the requesting form SET DATASESSION TO &piDataSession * Save the currently selected work area in the form's session lcAlias = ALIAS() * Select the work area you and do what you need to do SELECT Customer SKIP * Restore the work area in the form's data session IF NOT EMPTY(lcAlias) SELECT (lcAlias) ELSE SELECT 0 ENDIF * Restore the data session for this object SET DATASESSION TO &liDatasession * get out of here RETURN