Syntax errors are detected by the C/AL compiler when you try to compile C/AL code, either in a codeunit or as code in another object, such as a table, form, page, report, or dataport. The compiler will notify you of the error.

Correcting Syntax Errors

The compiler will notify you of a syntax error. When you press ENTER and acknowledge the error message, the C/AL editor will appear with the cursor in front of the offending expression.

A syntax error can be caused by a misspelling, a missing colon, or by code that uses undeclared variables. The compiler will not compile code that contains a syntax error, such as a missing THEN in an IF statement, or code that uses undeclared variables.

See Also