Skip to content

A Custom Event's condition (built around a SQL comparison using a substitution variable like &NEW:NCR_NO) works correctly when the triggering record isn't connected to a related object, but throws ORA-01722 ('Invalid Number') once it is connected — even though running the exact same SELECT statement directly in Oracle evaluates correctly and returns the expected result.

Answer

Check whether the substitution variable is wrapped in single quotes in the event's actual condition/SQL — a string-type substitution variable like &NEW:NCR_NO needs to be quoted (as '&NEW:NCR_NO') the way you would quote any string literal in SQL; leaving it unquoted can work in some simpler evaluation paths but fail with an invalid-number error once the event's logic hits a comparison or join that forces an implicit (and in this case invalid) numeric conversion. Testing the exact statement directly in a SQL tool doesn't catch this, since you'd naturally type the value already quoted there — the substitution-variable version inside the event needs that same quoting explicitly added.

← Browse Developer Studio, deployment, and upgrades questions