Question how to display browser fields dynamically

I'm displaying temp-table fields in a browser using free form query. i have 10 fields in my temp table but i want to hide and show some fields based on a condition
i have tried this below code on row display of browse trigger , but i'm getting the error as you can see in the picture.Screenshot 2023-04-12 110821.png



Code:
DO:
        DEFINE VARIABLE hanCol  AS HANDLE  NO-UNDO.
        DEFINE VARIABLE logHide AS LOGICAL NO-UNDO.

        hanCol = BROWSE brwsCustomers:first-column. 
                
        DO WHILE VALID-HANDLE(hanCol):                   
            IF logHide AND hanCol:NAME = "Customer ID" THEN
                HIDE hanCol. 
            ELSE
                VIEW hanCol.   
                  
            hanCol = hanCol:NEXT-COLUMN.                   
        END.
 
Firstly, the row display trigger is the wrong place to hide and view browse columns so needs to be applied in a separate place.

Secondly, to hide or view a browse column you use the VISIBLE attribute. This article hopefully will help:

 
Back
Top