Question How to check whether Browse widge has value or not

PRAMOD-NAIR

New Member
I have two browse Widget now i want to check whether particular browse has data or not before selecting all the fields.
I am selecting all the rows on CHOOSE event of button SelectAll:

IF BROWSE-5:NAME NE "" THEN
BROWSE-5:SELECT-ALL().

ELSE

IF BROWSE-6:NAME NE "" THEN
BROWSE-6:SELECT-ALL().

Should i use Name attribute or Screen-Value attribute for browse widget.
Should i put check on TempTable used to load Browse widget or i have to check data available on Browse Widget currently i am checking Browse in IF condition.
 

Osborne

Active Member
Are you wanting to select rows in a browse and to check whether any of the selected rows contain a value? If so, does something like this help?:
Code:
DEFINE VARIABLE vCount AS INTEGER NO-UNDO.
DEFINE VARIABLE vValueFound AS LOGICAL NO-UNDO.

DO vCount = 1 TO BROWSE-5:NUM-SELECTED-ROWS:
   BROWSE-5:FETCH-SELECTED-ROW(vCount).
   GET CURRENT BROWSE-5 NO-LOCK.
   /* Processing here to check the fields for the value */
   IF vValueFound THEN
      LEAVE.
END.
 

PRAMOD-NAIR

New Member
Are you wanting to select rows in a browse and to check whether any of the selected rows contain a value? If so, does something like this help?:
Code:
DEFINE VARIABLE vCount AS INTEGER NO-UNDO.
DEFINE VARIABLE vValueFound AS LOGICAL NO-UNDO.

DO vCount = 1 TO BROWSE-5:NUM-SELECTED-ROWS:
   BROWSE-5:FETCH-SELECTED-ROW(vCount).
   GET CURRENT BROWSE-5 NO-LOCK.
   /* Processing here to check the fields for the value */
   IF vValueFound THEN
      LEAVE.
END.
Thanks a lot Osborne. Its working.
 
Top