Hide certain fields in a Grid by means of various conditions

Hide certain fields in a Grid by means of various conditions

When you need to hide fields through various conditions within the Grid, we can do it through a query.

The first thing we are going to do is a query and we will store it inside a variable.

Then we use the macro sc_lookup.

After using said macro, we proceed to store it in an array, since within a Grid it is not possible to directly reference the field to make comparisons.

So in this example we are going to be using the macro sc_field_display which is the one that allows to show or hide a said field based on a condition.

Next the example:



    • Related Articles

    • Hide new grid button at runtime

      To hide the grid buttons we will use the sc_btn_display() macro, this macro shows and hides the buttons in the toolbar at run time. 1- We use this macro in the OnScriptInit event of our grid, referring to our new button as “new”: 2- We run the ...
    • Filtering data within a grid

      To filter certain information within a Grid, the WHERE clause can be used. - An application of the Grid type must be created    2. Then within the query that is going to be done, the filter is placed in a field and a global variable will be used to ...
    • Hide/Show "Retrieve Password" field on login screen with HTML template

      In this article, we will learn how to enable the "Hide/Show" feature that is available within the "Security -> Settings" option, for the "Retrieve Password" field that is found on the login screen that was generated with HTML template. Currently, ...
    • Hide/Show "New User" field on login screen with HTML template

      In this article, we will learn how to enable the "Hide/Show" feature that is available within the "Security -> Settings" option, for the "New User" field found in the login screen that was generated with HTML template. Currently, this feature is ...
    • Dividing fields into blocks

      In a block we can separate in a previously organized way the fields that belong to the Form. In this style of organization, we can create several blocks and give the Form a more flexible and pleasant layout for the end user. For you to create a block ...