Creating Business Rules with Lookup Tables

Objective

After completing this lesson, you will be able to configure business rules using lookup tables to automatically populate data.

Business Rules using Lookup Tables

Lookup tables, when integrated with business rules, offer a powerful method for automatically populating data fields within various applications. They excel at handling complex logic, making data entry faster and more accurate. This lesson uses the example of populating the ERP Amount field in a job requisition based on the Job Function and Country fields.

Before you begin, you'll need a custom object already created that serves as your lookup table. This object contains the predefined relationships between job functions, countries, and their corresponding ERP amounts. This preconfiguration is crucial for the business rule to function correctly.

Business Rule Logic

Once your lookup table is ready, the next step is to build a business rule that utilizes this table. As the logic of the business rule (variables needed to determine the desired outcome) are stored within the lookup table itself, the business rule becomes simplified. This supports easier maintenance of the business rule as well as system performance.

  1. Trigger Condition:
    • The business rule will have an If statement that triggers when the Job Function and Country fields are populated.
    • In the Then statement of the rule, you will use the Lookup function to retrieve the appropriate ERP amount from your custom lookup table.
  2. Lookup Function: The lookup function will take the current job classification and location from the job requisition as input parameters and return the corresponding ERP amount from the ERPLookupTable.
  3. Data Retrieval: The rule will then set the ERP amount field on the job requisition using the value returned by the lookup function.

Configure the Business Rule using Lookup Tables

Steps

  1. Navigate to Admin Center→Configure Business Rules.

  2. Create a new rule by selecting + sign.

    1. Expand the Recruiting category and choose a suitable scenario for the business rule you want to create. The scenario of the business rule is determined by the usage. For example, in the example of the ERP Amount Lookup Table, this data would be used on the job requisition.

    2. Make the required entries, including:

      • Rule Name
      • Rule ID (prepopulated by the system)
      • Effective Date
      • Description
      • Any additional fields that may be required, depending on the scenario selected
  3. Create the IF statement:

    1. Depending on the business requirements, you may or may not need an IF statement to decide when the rule should trigger.

    2. In the example of the ERP Amount Lookup Table, this rule should trigger IF the ERP Amount field is blank (or equal to Null).

  4. Create the THEN statement, using the Lookup function:

    1. Within the THEN statement, use the Set output to populate the desired field.

    2. In the left statement, select the desired field you wish to populate using the lookup table. In this example, the ERP Amount field would be selected from the job requisition.

    3. Leave is equal to as it appears.

    4. Change decimal to the Lookup() function.

    5. Select the Metadata Framework object that serves as the lookup table.

    6. Select the Output field, which is the field within the lookup table that should be extracted.

  5. Set the Effective Date:

    If the Metadata Framework object is effective-dated, you will see a field called Effective Date is equal to. You can select one of the following options:

    • System Context.Effective Date (Recommended): The effective date of the business process that triggered the rule.
    • Today(): The current date.
    • As Specified in Expressions Below: Specify the effective date or period in the expressions of the Lookup collection filter. If not specified, the system will consider data records that exist throughout the whole validity period of the object.
  6. Set the Lookup Table Expressions:

    Create expressions to validate that the data within the lookup table matches the data within the appropriate job requisition fields. If multiple variables should be validated before the ERP amount is populated into the field, then create an expression for each variable.

  7. Save the rule:

    This will ensure that your business rule is ready to use and will automatically populate the ERP amount in the job requisition based on the data in your lookup table.

  8. Apply the rule:

    Navigate to Manage Rules in Recruiting. Select the appropriate tab and template and then apply the business rule.

Result

Screen shows the configuration of a business rule, setting the ERP Amount field using the Lookup() function. The ERP Amount field is selected where the effective dating matches the system context, and the expressions for function and job level are validated.

Summary

  • Lookup tables provide a structured way to map input values to output values.
  • Business rules, using lookup functions, automate data population based on defined criteria.
  • The lookup function queries the lookup table based on the values of specified fields.
  • Effective dates in lookup tables need careful consideration when configuring the lookup function.
  • This automation reduces manual data entry, improving data accuracy and efficiency.