Announcement

Collapse
No announcement yet.

Check FirstKey/SecondKey User

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Check FirstKey/SecondKey User

    Check FirstKey/SecondKey User

    This macro is designed to disallow a user from second keying a record that was fisrt keyed by them. A message box is displayed to the user when the record is loaded to notify them, then the screen is cleared.

    Macro sclFirstKey.sas
    Code:
    /**************************************************
    
        Macro sclFirstKey.sas
        
        Purpose:  
            Checks that the second key user is not 
            the same as the first key user.
    
        Modifications:
        
            6/2/2008 - GW
            Added check of statusCode so that 
            records already verified do not 
            clear. This allows a user to 
            navigate sequenced records even
            if they first keyed them.
    
    **************************************************/
    %macro sclFirstKey;
        ** Get identifier for record information object **;
        dcl object f info;
        f=_self_.frameid;
        f._getNumVar('recordInfo',info);
        
        if info.entryMode='VERIFY' and info.StatusCode ^= 'V' then do;
            if info._usersKey=info._firstKeyUsersKey then do;
                msglist={'You are not allowed to verify this record','because you first keyed it.'};
                dcl char rcc=messagebox(msglist,'I','O','Note');
                msglist=dellist(msglist,'Y');
                call execcmd('clear');
            end;
        end;
    %mend sclFirstKey;
    Add call to onLoad(); method
    To implement, save the macro into a global, source or study level macro directory and then add the macro call to the screens onLoad(); method as follows:

    Code:
    %sclFirstKey;
    For more information on using macros within SCL code, please see the following post:
    Attached Files
    Last edited by Greg Wagner; 12-02-2011, 10:57 AM. Reason: Updated code
Working...
X