CheckEmployeeMasterViewSecurity

Check Employee Master View Security

Minor Business Rule

Object Name: B0500450

Parent DLL: CHRM

Location: Client/Server

Language: C


Function Description


This business function is designed to fill a gap in OneWorld row security. It allows you to apply the row security that is set up 

on the Employee Master table (F060116) to the employee records in another table. This is necessary in cases where the 

F060116 table is not included in the application's business view. 


The function is called at the start of an application to open the F060116 table and cache the table handle. Subsequent calls 

are made to determine whether the user can access the F060116 table for individual employees. Prior to closing the application, 

a final call is made to destroy the cache and close the F060116 table.


Parameters


cActionCode - Input

Pass one of the following values depending on the action you wish to take. 
1 - initialize cache
2 - get view security settings for an employee

3 - terminate cache


szCacheName - Input/Output

The name assigned to the cache at the time it is created. This value is returned to the calling process when the cache is 
first initialized (Action Code 1), and passed back to the function in subsequent calls (Action Code 2 or 3).


mnAddressNumber - Input

The address book number of the employee whose view security you wish to test.

cViewDataYN - Output

One of the following values is returned depending on the results of the view security test.
Y - view access to the employee's F060116 record is allowed
N - view access to the employee's F060116 record is denied


cSuppressErrorMessage - Input

Pass one of the following values to toggle error message display on and off.
0 - display error messages
1 - suppress display of error messages


szErrorMessageID - Output

If the function encounters an error, the ID of the error message is returned in this parameter. A blank is returned if the 
function completes with no errors.


Function Use


A call is made to the function at the beginning of a process in order to initialize the cache and open the F060116 table. 

Typical  parameter settings for this call to the function are as follows.


cAction Code  I1

szCacheName   IOfrm_szCEMVSCacheName_JOBN

(CEMVS - Check Employee Master View Security)

szAddressNumber  xNot Assigned

cViewDataYN  xNot Assigned

cSuppressErrorMessage  I0 or 1

szErrorMessageID  Ofrm_szErrorMessageID_DTAI


If the initialization fails, subseqent calls to the function return an N, view access denied, in the cViewDataYN parameter. To 

avoid this situation, the szErrorMessageID parameter can be checked and the appropriate action taken if an error is returned.


Subsequent calls are made with Action Code set to 2 in order to check the view security for individual employees. Typical 

parameter settings for this call to the function are as follows.


cAction Code  I2

szCacheName   IOfrm_szCEMVSCacheName_JOBN 

szAddressNumber  IEmployee's address book number

cViewDataYN  Oevt_cViewDataYN_VWYN

cSuppressErrorMessage  I0 or 1

szErrorMessageID  Ofrm_szErrorMessageID_DTAI


If an N is returned in the cViewDataYN parameter, appropriate action can be taken to exclude the employee's records from 

the application, report, or process. An N is returned in the cViewDataYN parameter whenever an error is encountered by the 

function. For this reason, it might be useful to check the szErrorMessageID parameter in conjunction with cViewDataYN in 

order to formulate the best action to take.


A final call is made with Action Code set to 3 to close the F060116 table and destroy the cache. Typical parameter settings 

for this call to the function are as follows.


cAction Code  I3

szCacheName   IOfrm_szCEMVSCacheName_JOBN

szAddressNumber  xNot assigned

cViewDataYN  xNot assigned

cSuppressErrorMessage  I0 or 1

szErrorMessageID  Ofrm_szErrorMessageID_DTAI



Data Structure

D0500450 - Check Employee Master View Security


Parameter NameData ItemData TypeReq/OptI/O/Both
cActionCodeACTNcharOPTNONE


szCacheNameJOBNcharOPTNONE

The code that identifies the work station ID that executed a particular job.

mnAddressNumberAN8MATH_NUMERICOPTNONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

cViewDataYNVWYNcharOPTNONE

This code designates whether a user has the authority to view data either on a specific application or form (processing option and column 
security) or for a specific table and data item (row security). This code is set up through Security Workbench by user or group for every table, 
application, or form requiring security. *ALL can be used to designate all tables or applications.

cSuppressErrorMessageSUPPScharOPTNONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharOPTNONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

Related Functions

None

Related Tables

F060116 Employee Master Information