Domino & Notes error

No main or selected expression in formula

Formula compile error shown when saving.

What it means

The formula doesn't end in an expression that returns a value, or a view selection formula has no SELECT statement.

Common causes

  • The formula only contains variable assignments with nothing returned at the end
  • A view or agent selection formula missing SELECT
  • The last line is a FIELD assignment or an := statement

Quick fixes

  1. Add a final line that returns a value, for example the temporary variable's name
  2. Add a SELECT statement to view and agent selection formulas
  3. Add @All or "" as the last line if no return value is needed

Need a hand with this?

Paste your exact message into What's That Error? for a plain-English explanation, or get in touch. I've been supporting Domino and Notes for 28 years.

Disclaimer

The errors, causes and fixes on this site are carefully researched, drawing on HCL documentation and 28 years of hands-on Domino and Notes experience. Every environment is different, though, and a solution that works in one may not be right for yours. Exact wording can also vary between Domino and Notes versions.

This information is general guidance only and is provided without warranty of any kind. Always back up your data and test changes on a non-production system first. To the extent permitted by law, Bruinsma Services Pty Ltd accepts no responsibility or liability for any loss, damage, downtime or other consequence arising from use of this information. For advice specific to your environment, please contact me.