Syntax Error Code Statement 2 42 Peoplecode -
: You are calling a function that has not been defined or declared at the top of your program.
: Placing logic that requires a specific context (like a Function definition) inside an event like Page Activate without proper header declarations. How to Fix the Error Syntax Error Code Statement 2 42 Peoplecode
: Ensure "Word Wrap" is turned off under the View menu to ensure the statement numbers match what the compiler is reporting. : You are calling a function that has
Example: Declare Function MyFunction PeopleCode RECORD_NAME.FIELD_NAME FieldFormula; . Example: Declare Function MyFunction PeopleCode RECORD_NAME
: If you have added new logic to an existing event (like Page Activate ), try moving your new code or function definitions to the top of the event. Understanding the Error Format
The numbers in parentheses represent where the compiler stopped: : The error category (Syntax/Parser error). 42 : The statement number where the compiler failed.
: An internal function definition is placed in the middle of other logic. In PeopleCode, functions must often be defined before they are called within the same event.
Thank you!
