     H BNDDIR('LRNGSRV') DFTACTGRP(*no) ACTGRP(*caller)
     D  StrVar         S            256A   Varying Inz('')
     D
      /INCLUDE LRNGSOURCE,LRNGCOMMON
      /INCLUDE SOURCEDEMO,DEMOCOMMON
      /INCLUDE SOURCEDEMO,STDPARAMS

      /free
        DoU (RequestPROGRAM <> ProgramINFO.Name);
           Exsr HandleRequestedAction;
           Exsr DisplayFormView;
        Enddo;
        *InLR = True;
        Return;

       Begsr HandleRequestedAction;
       Endsr;

       Begsr DisplayFormView;
          // Hide Button
          LRNG_Using('/Form.Fields.HideButton');
          LRNG_SetProperty('Layout.Row' : '1');
          LRNG_SetProperty('Type' : 'Button');
          LRNG_SetProperty('Text' : 'Hide Menu Item');
          LRNG_SetProperty('OnClick.Operation.Type' : 'ExecScript');
          LRNG_SetProperty('OnClick.Operation.Resource' :
                'test_change_menu_item_visibility.js');
          LRNG_SetProperty('OnClick.Operation.Script' : 'hideMenuItem()');
          LRNG_EndUsing();

          // Show Button
          LRNG_Using('/Form.Fields.ShowButton');
          LRNG_SetProperty('Layout.Row' : '2');
          LRNG_SetProperty('Type' : 'Button');
          LRNG_SetProperty('Text' : 'Show Menu Item');
          LRNG_SetProperty('OnClick.Operation.Type' : 'ExecScript');
          LRNG_SetProperty('OnClick.Operation.Resource' :
                'test_change_menu_item_visibility.js');
          LRNG_SetProperty('OnClick.Operation.Script' : 'showMenuItem()');
          LRNG_EndUsing();

          // Form OnLoad
          LRNG_Using('/Form.OnLoad.Operation');
          LRNG_SetProperty('Type' : 'ExecScript');
          LRNG_SetProperty('Resource' : 'test_change_menu_item_visibility.js');
          LRNG_SetProperty('Script' : 'hideMenuItem()');
          LRNG_EndUsing();

          // Use this if no DDS:
          LRNG_SendReceive(*OFF:RequestPROGRAM:RequestACTION);

          // Get the requested action to take - and the program to handle it.
          LRNG_GetRequestedAction(RequestPROGRAM:RequestACTION);
       Endsr;
      /end-free 