Workday errors in plain English.

Submit an Error

Extend PMD 'Unknown Variable' Error When Clearing a Widget Value With Double Quotes

✓ Verified Workday Extend 6 lookups
The error Exception thrown while processing 'onChange' event in tag of type 'radioGroup' with id 'ExemptionReason' declared at 'reviseEvent' Unknown Variable found: ExemptionReasonOther

What does "Extend PMD 'Unknown Variable' Error When Clearing a Widget Value With Double Quotes" mean in Workday Extend?

An onChange script tried to clear a text widget using double-quoted empty strings (widget.value = "") or setValue(null). The AMD/PMD expression language only recognizes single-quoted string literals, so a double-quoted empty string is not parsed as an empty string value, and the runtime reports the widget reference itself as an unknown variable instead of a quoting problem.

Quick fix

Change the double-quoted empty string or null assignment to a single-quoted empty string: widgetName.setValue('') or widgetName.value = ''.

Permanent fix

Standardize on single quotes for all string literals in AMD/PMD expressions across a project (some teams add this to a code review checklist), since double quotes silently fail to parse as literals rather than throwing an obvious syntax error.

Troubleshooting

  1. Confirm the failing line is trying to assign or clear a widget value, then check which quote character is used around the literal.
  2. Replace any double-quoted string literal in the expression with single quotes, AMD/PMD expressions only treat single-quoted text as string literals.
  3. If clearing the field, use widgetName.setValue('') or widgetName.value = '' rather than null or a double-quoted empty string.
  4. Re-test the onChange handler after the change, the 'Unknown Variable' message clears once the literal is recognized correctly.
Was this helpful?

Related errors