Create and Default Context for Descriptive Flexfield Based on Document Type

When you create a document record, the flexfield segments are displayed based on the context selected for the document type. You can configure the flexfield context for a document type such that it's automatically selected when you create a document record.

This example shows how you can do so.

To automatically populate the context, you must enter a context code for the document flexfield that exactly matches the internal document type.

The internal document type is generated as follows:

  • Document type is valid for a specific country: The internal document type is derived as country code_document type name, all in uppercase. The spaces and hyphens in the document type name are replaced with underscores. For example, if the document type name is Loan Request and the document type is valid for India only, the internal document type takes the value IN_LOAN_REQUEST.

  • Document type is global: The internal document type is derived as GLB_document type name. For example, if the document type name is Loan Request and the document type is valid for all countries, the internal document type takes the value GLB_LOAN_REQUEST.

Consider the following example where you want to default a flexfield context based on the document type.

Business Requirement

You want to configure a custom loan request form using the Document Records functionality. You want to configure the following attributes as part of this custom loan request form:
  1. Loan Start Date

  2. Loan Type

  3. Loan Reason

  4. Loan Value

  5. Employee Guarantee 1

  6. Employee Guarantee 2

Summary of Tasks

  1. Configure a document type.

  2. Define the descriptive flexfield (DFF) for document records.

  3. Define six segments for the PER_DOCUMENTS_OF_RECORD_DFF Document Records DFF.

  4. Verify that the context value is automatically defaulted and all segments configured for the context are automatically displayed.

Configure a Document Type

Configure a document type with Type = Loan Request. To do this, follow these steps:
  1. In the Setup and Maintenance work area, go to the following:

    • Functional Area: Workforce Information

    • Task: Document Types

  2. In the Search Results area, click the Create icon.

  3. In the Document Type Information page, enter these values:

    • Type: Loan Request

    • Description: Loan request for employees.

    • Country: Search and select India

    • Category: Benefits

  4. Click Submit, and then click Yes.

  5. Click OK, and then click Done.

Define the DFF for Document Records

Define the PER_DOCUMENTS_OF_RECORD_DFF descriptive flexfield. To do this follow, these steps:
  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, click Edit on the Actions menu.

  3. Verify that the Derivation Value field in the Context Segment area is configured with the SYSDOCTYPEDFF value.

  4. Click Manage Contexts.

  5. In the Search Results area, click the Create icon.

  6. In the Create Context page, enter these values:

    • Display Name: Loan Request

    • Context Code: IN_LOAN_REQUEST

  7. Click Save and Close.

    Important: Ensure that the context code is the same as the System Document Type.

    Note: System Document Type is an internal code. Its value is derived by the application using the following logic:

    For example, in this case since document type (Loan Request) is specific for the country India, the document type will be IN_LOAN_REQUEST

    If this document type was defined for all countries (global), then the document type would be GLB_LOAN_REQUEST.

  8. Search the IN_LOAN_REQUEST context code in the Manage Contexts page.

  9. In the Search Results area, select the Loan Request row, and click Edit on the Actions menu.

Define Segments for the Document Records DFF

Create the following segments as per the business requirement for the context you created:
  1. Loan Start Date

  2. Loan Type

  3. Loan Reason

  4. Loan Value

  5. Employee Guarantee 1

  6. Employee Guarantee 2

To do this, follow these steps:

  1. In the Context Sensitive Segments area, click the Create (+) icon.

  2. In the Create Segment page, enter these values:

    • Name: Loan Start Date

    • Data Type: Date

    • Display Type: Date/Time

  3. Click Create Value Set.

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

    • Value Set Code: CZ_DATE

    • Module: Search and select Global Human Resources

    • Value Data Type: Date

  5. Click Save and Close.

  6. Repeat steps 1 through 5 by using values from this table for the remaining segments:

    Name

    Data Type

    Display Type

    Value Set Code

    Value Data Type

    Loan Type

    Character

    List of Values

    Loan_Type

    Character

    Loan Reason

    Character

    List of Values

    Loan_Reason

    Character

    Loan Value

    Number

    Text Box

    15 Number

    Number

    Employee Guarantee 1

    Character

    Text Box

    10 Characters

    Character

    Employee Guarantee 2

    Character

    Text Box

    10 Characters

    Character

  7. Click Save and Close three times to return to the Document Records Descriptive Flexfields page.

  8. Click Deploy Flexfield. During the deployment process, validate the messages for any errors or warnings.

  9. Click OK, and then click Done.

Verifying Automatic Default of Flexfield Context Based on Document Type

  1. Log in as an employee and create a document record of type Loan Request. Notice that the context value will be automatically defaulted and all segments configured for the context will be automatically displayed.

  2. If you change the document type, the appropriate context value will again be defaulted and all segments for the corresponding context code will be displayed automatically.