How do I build a simple autocomplete rule?

Title and music.

In this video, you’ll learn how to build a simple validation rule using the autocomplete rules editor. This is to get you familiar with the navigational elements of the editor and to learn how to handle variables and functions.

You’ll create a rule that validates the effective date section in the When and Why region. The rule will validate that the date is not in the past. I’m signed in as an implementer. The yellow toolbar at the top of the page indicates that I’m already in a sandbox. To navigate to the autocomplete rules editor, click the Tools menu on the yellow tool bar and select HCM Experience Design Studio.

Enter your sandbox for autocomplete rules changes.

On the yellow sandbox toolbar, click the Tools menu.

Select HCM Experience Design Studio.

Click the Autocomplete Rules tab.

On the Autocomplete Rules tab, select the When and Why business object. Then we’ll add an Object Validation Rule.

In the Business Object drop-down list, select When and Why.

In the Rules section, click the Add button.

Select Object Validation Rule Type.

Then you come to the Edit Rule page. Enter a name for the rule. Notice that the Active checkbox is selected by default. The rule will trigger only if it is Active. A new rule automatically has a string variable in the Rule Logic section. You’ll add a condition block after it to conditionally validate the rule.

On the Edit Rule page, in the Basic Info section, in the Name field, enter Start date must not be in the past.

In the Rule Logic section, click the down arrow to the left of the default string variable.

Select Add next.

Select Add condition block.

Then, select the Delete else block option. In this demonstration, we don’t need an Else section as part of our condition.

Click the down arrow next to If.

Select Delete else block.

Delete the default string variable as you don’t need it for this rule.

Click the down arrow next to the default string variable.

Select Delete.

Click the Equal to operator and change it to Less than.

Click the Equal to hyperlink.

Select Less than.

Then, click the XYZ icon to the right of the Less than operator and select Change to a function. It changes to a function for Today’s date.

To the right of the Less than operator, click the XYZ icon.

Select Change to a function.

Click the down arrow next to the string variable and select Add next then Add error message.

Click the down arrow next to the string variable.

Select Add next.

Select Add error message.

We now enter the error message text we want to display.

In the Show an error message, enter The effective start date cannot be in the past..

Delete the variable.

Click the down arrow next to the default string variable.

Select Delete.

The rule is done. It will trigger an error message if a user enters a past date in a When and Why section. Click save and close

Click Save and Close.

To test the rule, go to the Transfer page, for an employee.

Click the Home icon.

Under the Quick Actions section, click Show More.

In the Employment section, click Transfer.

On the Transfer page, in the Search field, enter Chloe Johnson.

Click Chloe Johnson.

Here, we change the transfer start date to a date in the past and click Continue. And you see the validation rule is triggered.

In the When and Why section, in the When does the transfer start? field, change the date to yesterday.

Click Continue.

View the error message.

For more information on this topic, you can view the courses on Oracle University or reference the available guides on Oracle Help Center.

Thanks for watching.

Oracle copyright and music.