Subfunction HideFields to create System Fields

    This is a sub function that will add the tag hidden to each field within a table. after that, these fields will be visible only when "show system fields" is checked on.


    It's useful when there are fields that are not needed to be selectable by data model final users

     

    SUB HideFields (vDLX.Table)
    /**
    * @Description Subfunction HideFields will add the tag hidden to each field within a table.
    * after that this fields only will be visible when "show system fields" is checked on.
    * @author  Alberto Rodríguez Bernárdez
    * @DateYMD 20170104
    * @Version 1.0
    **/
    
    
    /**
    * @parameter 1 vDLX.Table: Table name which fields will be hidden as system fields
    */
      Trace hiding fields of table $(vDLX.Table);
    
      for vDLX.Temp=1 to NoOfFields('$(vDLX.Table)')
      Let vDLX.FieldName = FieldName($(vDLX.Temp),'$(vDLX.Table)');
      TAG Field [$(vDLX.FieldName)] with '$hidden';
      comment field [$(vDLX.FieldName)] with 'Its a hidden field';
      NEXT
    
    /**  Example of use **/
    /**  Call to subfunction HideFields('<Table>');
    
    
      CALL HideFields('LOG') ;
    
    
    */
    
    
    ENDSUB //End Subfunction HideFields
    
    

     

    Thanks for your feedback and comments.

     

    Best regards,


    Alberto Rodríguez