: A preceding line is missing a semicolon ( ; ), causing the compiler to misread the subsequent line as part of an invalid statement.
The error in PeopleCode is a generic syntax error message meaning "expecting statement" . It occurs during code validation or when saving PeopleCode in Application Designer because the compiler encountered a line it did not expect or cannot parse. Common Causes for Error (2,42) Syntax Error Code Statement 2 42 Peoplecode
Example: Declare Function MyFunction PeopleCode RECORD_NAME.FIELD_NAME FieldFormula; . : A preceding line is missing a semicolon
This error typically occurs when code is placed in the wrong order or is missing a mandatory declaration. Common Causes for Error (2,42) Example: Declare Function
If you’d like, I can help you debug specific code. Just let me know:
: Ensure any internal or external functions are declared at the very top of your PeopleCode program, immediately after any Component or Global variable declarations.