!!Get Employee EASD_ID value for the latest prime assignment

!Functionality:
This function retrieves the ID for [P2K_HR_ASSIGNMENT_DETAILS] for the Prime Assignment detail record that is the most future, linked to the last hire date.

!Parameters:

|PERSON_CODE     | ''Optional''.  The [PERSON_CODE] for the employee.
|GOVERNMENT_CODE | ''Optional''.  The [GOVERNMENT_CODE] for the employee.

!Returns: 
Numeric

!Errors:  
* If no data is found (the employee cannot be found using either code), -2 is returned
* If no employment record is found (corrupt data), -3 is returned
* If no prime assignment record is found expiring at the end of time, -4 is returned
* If any error occurs during data retrieval of the IDENTITY record, by Government Code then -99 is returned
* If any error occurs during data retrieval of the IDENTITY record, by Person Code then -96 is returned
* If any error occurs during data retrieval of the EMPLOYMENTS record, then -98 is returned
* If any error occurs during data retrieval of the ASSIGNMENT/ASSIGNMENT_DETAILS records, then -97 is returned

!Example: 

{{P2K_PU.GET_EASD(~)}}

will get the EASD_ID value for the passed person code

{{P2K_PU.GET_EASD(0,~)}}

will get the EASD_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. 
* [GOVERNMENT_CODE] will be filled with leading zeroes, to make it nine digits long, and any hyphen separators provided, will be stripped out.
----
![Notes|Edit:Internal.P2K_PU.GET_EASD]
[{InsertPage page='Internal.P2K_PU.GET_EASD' default='Click to create a new notes page'}]