Getting started
If you are new to Autocomplete, refer this blog on how to enable Autocomplete and key links to get you started. You must complete the comprehensive training if you are the implementor.
Review underlying groovy code
The error messages resulting from Autocomplete rules provide the line number in the code that is causing the issue (in most cases). The error message will read something like ‘Error in Expression…..Line#’. The line number cited in the error message refers to the line number of the groovy code that’s generated by Autocomplete Rules and not the rule line.
For example, the error below shows that the Java Null Pointer exception is coming from line 3 and line 2 of the underlying groovy code respectively.
“oracle.apps.hcm.payrolls.registrations.protectedMode.entity.PayrollRelationshipGroupDEO” trigger
“PAYROLL_ASSIGNMENT_DVO_TIME_CARD_DFLT” :
java.land.NullPointerException : Cannot invoke method reset() on null object at “oracle.apps.hcm.payrolls.registrations.protectedMode.entity.PayrollRelationshipGroupDEO” trigger
“PAYROLL_ASSIGNMENT_DVO_TIME_CARD_DFLT” line 3
Cannot invoke method reset() on null object
at “oracle.apps.hcm.employment.core.publicModel.entity.BaseWorkerAssignmentDEO” validation rule “Transfer_Position_Validation_with_Requisition” line 2
To get to the underlying groovy code, follow the steps below –
- Add Configure Business Objects tool to your sandbox
- Navigate to Configure Business Objects
- Click on Actions against the object in which you have created the Autocomplete Rule. Select Edit Business Logic.
- By default, this opens validation rules for the given object. Select Triggers from the drop down if you want to review a defaulting rule.
- Object Validation Rule: Validation Rules –> Object Rules
- Field Validation Rule: Validation Rules –> Field Rules
- Object Defaulting Rule: Triggers -> Object Triggers
- Field Modification Rule: Triggers -> Field Triggers
- Click on the Rule Name/Trigger to open the Groovy editor and review the underlying code
- Check the line # from the error message to identify the line of code that is causing the issue
Based on the error message, you now know the line of code that is causing the issue. For example, if it is a Java null pointer exception on line 6 in the above code, check for NULL before you declare it (see line 5).