CurrForm.CLOSE syntax error

I’m trying to close a form with code (on the same form). Something like

IF (Condition is TRUE) THEN CurrForm.CLOSE.

I have done that in the past without problems. But on this particular form I’m getting a syntax error when compiling. On acknowledging, the cursor goes to the end of the CurrForm.CLOSE statement, no matter where I put the statement. Tried on triggers and on a function.

If anyone knows of any property or anything that might get this CLOSE function not to work please let me know.

Thanks in advance,

Sebastian

Can you show complete code.

IF Condition THEN

CurrForm.CLOSE;

IF BooleanField = TRUE THEN CurrForm.CLOSE;

The boolean is auto populated by a function based on user input.

But, even if I write “CurrForm.CLOSE;” on its own it comes with the Syntax Error message when compiling.

Did you checked on standard form how it is written.

Does the message say anything other than Syntax Error ? What is the entire message.

What version of NAV are you using ? Is it a FORM or is it actually a PAGE ? If it is a page you need to write CurrPage.CLOSE instead.