How do I default the effective date using an autocomplete rule?
Title and music.
In this video I’ll show you how to use an autocomplete rule to default the effective date when hiring a new employee. For this example, we’ll default the date to thirty days from the current date in the New Hire flow. This will make sure that the Payroll and HR teams have time to set up the new employee’s records.
First we’ll go to the autocomplete rules page in a sandbox. Notice by the yellow bar on the top of the page that we are in a sandbox.
From the Home page, click the Navigator icon.
Expand the Configuration section.
Click Sandboxes.
Enter your sandbox you set up to use for autocomplete rule changes.
Click Tools menu.
Select HCM Experience Design Studio.
Click the Autocomplete Rules tab.
Then we’ll go to the When and Why business object.
In the Business Object drop-down list, select When and Why.
For this example, we’re going to add an object defaulting rule.
Click Add.
Select Object Defaulting Rule.
Here we are on the Edit page for the new rule. Notice I’ve named the rule Effective Date Default and set it to active.
In the Name field, enter Effective Data Default.
Select the Active check box.
Next we build the logic for the rule. We start by assigning a variable to hold the Action Type Code. We need this because we want the rule to trigger only during the Add Employee action.
In the first line, in the variable value field, enter stringVar_Action Type.
In the same line, in the Get string value from HCM Params statement, enter EMP_Groovy_ActionType.
Next we then use a conditional clause to check that the Action Type is for the new hire flow.
In the If statement row, for row containing Var_ActionType Equal to, enter EMP_ADD_EMP.
If we are in the new hire flow, then the rule sets the effective date to be 30 days from the current date.
In row containing the When and Why.Action Date statement, select Today's Date.
Add the + operand.
Enter 30.
We can test the rule by going to the new hire flow. I’m testing this on Dec. 13, 2022, but you can see the effective date is defaulted to next month, January, 12, 2023.
Click the Home icon.
Click My Client Groups.
In the Quick Actions section, click Hire an Employee.
Notice that the When and Why section, for the When is the employee hire date? field defaults to 30 days from today.
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.