Configure Flexfield Parameters in Value Sets for Document Records

You want to use the person ID as an input parameter when creating a value set for a document record flexfield segment.

Business Requirement: Meg is an employee at Vision Corporation. She needs to create some document records for her contacts, for example, her spouse and mother. She should be able to easily select the name of the contact for whom she is creating the document record.

Summary of Tasks

  1. Define a segment for the PER_DOCUMENTS_OF_RECORD_DFF Document Records Descriptive Flexfield (DFF).

  2. Define a value set that will display the contact values based on the person ID of the employee (Meg).

Defining a Segment for the DFF

  1. In the Setup and Maintenance work area, go to the following:

    • Functional Area: Workforce Information

    • Task: Document Records Descriptive Flexfields

  2. On the Document Records Descriptive Flexfields page, select the Documents of Record Attributes row and click Edit on the Actions menu.

  3. Click the Create (+) icon in the Global Segments area and create a segment by entering these values:

    • Name: Contact

    • Description: Displays the list of contacts for an employee.

    • Data Type: Number

    Note: You need to create the segment under the GLB_BIRTH context code.

Defining a Value Set for the DFF

  1. Click Create Value Set.

  2. In the Create Value Set page, enter these values:

    • Value Set Code: EMP_CONTACT

    • Description: Value set containing the contacts of the employee.

    • Module: Search and select Global Human Resources

    • Validation Type: Table

    • Value Data Type: Character

  3. In the FROM Clause field, enter the following syntax:

    PER_CONTACT_RELSHIPS_F CR, per_person_names_f_v ppnf
  4. In the Value Column Name field, enter ppnf.display_name.

  5. In the ID Column Name field, enter ppnf.person_id.

  6. In the Start Date Column Name field, enter to_date(null).

  7. In the End Date Column Name field, enter to_date(null).

  8. In the WHERE Clause field, enter the following syntax:

    CR.PERSON_ID = :{PARAMETER.PERSONID}
    and CR.CONTACT_PERSON_ID = ppnf.person_id
    and trunc(sysdate) between CR.effective_start_date and CR.effective_end_date
    and trunc(sysdate) between ppnf.effective_start_date and
    ppnf.effective_end_date
  9. Click Save and Close three times to return to the Document Records Descriptive Flexfields page.

  10. Click Deploy Flexfield.

  11. Click OK, and then click Done.

    Log in as Meg and create a document record of type Birth. The contacts for Meg appear in the flexfield segment LOV. She can then select the contact for whom she wants to create the document record.

Defaulting a Value in a Flexfield Segment

When you use a value set, the display will always be a LOV, even if there is only one value in the value set. For scenarios where you want to default a single value in the specific flexfield segment, you need to select SQL as the default type value for the initial default.

This is a sample SQL to default a person number:

  1. To default the selected worker's person number:

    select person_number
    from per_all_people_f
    where sysdate between effective_start_date and effective_end_date
    and person_id = :{PARAMETER.PERSONID}
  2. To default the logged in user's person number:

    select person_number
    from per_all_people_f
    where sysdate between effective_start_date and effective_end_date
    and person_id = HRC_SESSION_UTIL.GET_USER_PERSONID