Autocomplete Errors

These are the common errors that you may encounter while implementing autocomplete rules.

Issue

Resolution

Rule doesn't trigger

Test the event with a simple rule to confirm whether the issue is with the triggering event or with the logic contained therein. This will help identify whether the invalid starting point is the business object or the rule type, before getting into the actual rule logic.

Rule triggers multiple times

If the same error message is shown multiple times, you may be working with the Assignment object where you haven't added the IF WorkTermsAssignmentId NOT NULL condition. Alternatively, you may be working on an action where multiple records of the same object are saved, for example Convert Pending Worker or Change Salary. In the latter case, you need to add the necessary additional condition for your rule to apply to only the record you're interested in.

Rule triggers too early

If the rule triggers too early, you're using an object that's shared across multiple sections and hence gets saved (and validated) at the end of each section. For example, Person Legislative Info, or Termination Info sections in the respective flows. You can do one of these things:

  • Sample values of fields in the section that hasn't yet been encountered to condition your rule.

  • Use HCM Params to determine when to trigger the rule. Else, the nature of the given object is such that it doesn't support validation rule as it's expected to be validated even before a section is accessed (for example, Payroll Assignment or Payroll Terms).

Rule triggers too late

The nature of the given object is such that it simply doesn't support validation rule immediately on exit of a section, as it's expected to be validated only during Submit. Work Measure and Salary are examples of such objects. Most objects are validated on Submit.

Works for some actions but not others

There are a number of exceptions where a rule only supports certain actions or fields. Refer to the known exceptions and adaptations for all business objects. If your condition falls under the category of known exceptions, this may not be supported as yet. If your condition falls under the category of known adaptations, then follow the instructions listed therein to implement the fix.

Error in Expression...Line#

These are the possible causes:

  • You specified an incorrect expression in an autocomplete rule, for example, using an invalid argument for pattern matching.

  • You're fetching a value from a related object where the object itself is initialized as Null.

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. These are the resolutions.

  • Java Null Pointer: Check for NOT NULL after initiating a related object row definition (of Variant 1 or 2). This helps in removing this error but may not necessarily provide you with the solution. You need to go to the Configure Business Objects task and edit your code to determine the reference to the line number where the error is in order to fix.

  • In some cases, you can manually fix this code in Groovy and test. But, if you edit the rule in autocomplete that has generated this code, it will remove any manual changes.

Error in Logic

There can also be an issue with the logic. You need to know the functional relationship between major objects and key attributes. You can build the rule incrementally, code elements, and gradually increase complexity by introducing variables to understand where you're going wrong.