1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

National identifier validation fast formula (oracle hrms - saudi arabia)

Discussion in 'Oracle HRMS & Payroll' started by Mohammad Zubair Umar, Mar 14, 2018.

  1. Mohammad Zubair Umar

    Mohammad Zubair Umar Active Member

    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    85
    Location:
    New Delhi
    The NI number format is as below :

    YYYYMMDDXXXXXXX ,

    where :
    YYYY = year of bith
    MM = month of birth
    DD = date of birth
    XXXXXXX = 7 digits number



    This can be seen in NI_VALIDATION formula :



    /* Declarations for parameters */
    inputs are national_identifier(text),
    birth_date(text),
    event(text)

    /* Default values initialization */
    default for birth_date is '4712\12\31 00:00:00'
    default for invalid_mesg is 'HR_AE_INVALID_NATIONAL_ID'

    invalid_mesg = 'HR_AE_INVALID_NATIONAL_ID'
    /* Check format of national_identifier */
    return_value = chk_nat_id_format(national_identifier, 'DDDDDDDDDDDDDDD')

    if return_value != '0'
    then
    (
    /* Initializing a local variable for national_identifier */
    l_national_identifier = return_value

    /* If Date of birth was inputed/entered */
    if birth_date was not defaulted
    then
    (
    /* 4-7 digits of l_national_identifier should be birth year */
    ae_birth_date = to_char(to_date(birth_date,'RRRR\MM\DD HH24:MI:SS'),'DD-MON-RRRR')
    if to_char(to_date(ae_birth_date,'DD-MON-RRRR'),'YYYY') != substr(l_national_identifier,4,4)
    then
    (
    return_value = '0'
    invalid_mesg = 'HR_AE_INVALID_NI_DOB'
    /* invalid_mesg = AE_GET_MESSAGE('PER','HR_AE_INVALID_NI_DOB') */
    )
    )
    )

    if return_value = '0' then
    (
    return_value = 'INVALID_ID'
    )

    return return_value,invalid_mesg