Get Employee EEMID value#

Functionality:#

This function retrieves the ID for P2K_HR_EMPLOYMENTS

Parameters:#

PERSON_CODE Optional. The PERSON_CODE for the employee.
GOVERNMENT_CODE Optional. The GOVERNMENT_CODE for the employee.
If you prefix the government code with the letter "E", then the EXTERNAL_RETIREMENT_ID field (without the "E") is used to retrieve the EID_ID
AS_OF Optional. The AS OF date is used to search for an active employment on or after that date. If not provided then the current date is used.

Returns: #

Numeric

Errors: #

  • If no data is found (the employee cannot be found using either code), zero 0 is returned
  • If any error occurs during data retrieval, -1 is returned
  • If neither person code or government code parameters are passed, then NULL is returned

Example: #

P2K_PU.GET_EID(~)

will get the EID_ID value for the passed person code

P2K_PU.GET_EID(0,~)

will get the EID_ID value for the passed government code. Note that the first parameter is optional, but must still contain a value.

Notes#

  • If you pass both GOVERNMENT_CODE and PERSON_CODE (as non-ZERO values), Government Code will be used first.
  • If the GOVERNMENT_CODE parameter starts with the letter "E" then this is tripped off, and the value left is used to inquire on EXTERNAL_RETIREMENT_ID
  • GOVERNMENT_CODE will be filled with leading zeroes, to make it nine digits long, and any hyphen separators provided, will be stripped out.
  • The AS_OF parameter is used to locate the employment record for the most future active record (by HIRE_DATE). If there are no active records (no TERMINTION_DATE) then the most future record by hire date is returned.

Notes#

Click to create a new notes page