Closing a form, and then opening a response

I am having issues with Domino. Heres my code:@If(Subscribe_E_Mail = “” | Subscribe_Building = “”;@Return(@Prompt([Ok];“Incomplete Information”;“Please complete information”));@Do(@Command([FileSave]);@Command([FileCloseWindow]);@Command([Compose];“SubConfirm”)))

The code looks right, and my intent is to save and close a form, then to open the “SubConfirm” form containing 2 pieces of information from the document created from the first form. However, this code saves the document, and doesnt even close the document or even open “SubConfirm”. But, if I remove the command to open “SubConfirm”, it will save and close. Can someone help me??

Subject: Closing a form, and then opening a response.

@command[FileCloseWindow] always executes after the other @functions. So what Notes does in your code:- save the document (@Command([FileSave]))

  • compose a SubConfirm document (@Command([Compose];“SubConfirm”))

  • close the SubConfirm document (@Command([FileSave]))

You could use @command([FileClose]) instead, this is executed immediately.

Another option in this case is to use @postedcommand instead of @commands, they are executed in the order that they are stated. But take in mind that those are all executed after all other @functions.

You can find documentation about this in the designer help if you search for “Order of evaluation for formula statements”

Good luck,

René

Subject: RE: Closing a form, and then opening a response.

Thanks, I changed my code to

@If(Subscribe_E_Mail = “” | Subscribe_Building = “”; @Return(@Prompt([Ok];“Incomplete Information”;“Please complete information”));

@Do(@Command([FileSave]);

@Command([FileCloseWindow]);

@PostedCommand([Compose];“SubConfirm”)))

However, now I’m gettin a “Invalid or non-existent document” error.

Subject: RE: Closing a form, and then opening a response.

That’s strange, 'cause that error is generated when Notes cannot find the form you are composing within the database.

Does the form “SubConfirm” still exists and if so, is it visible for Notes?

I tested the code in a database and it did work.

I should change the last @postedcommand in a @command function, there is no need to use @Postedcommand here.

Subject: Closing a form, and then opening a response.

I would do this, like this

@If(Subscribe_E_Mail = “” | Subscribe_Building = “”;@Return(@Prompt([Ok];“Incomplete Information”;“Please complete information”)); “”);

REM {If it comes this far then the conditions are met.};

@Command([FileSave]);

@Command([FileCloseWindow]);

@Command([Compose];“SubConfirm”)